fix(core): update

This commit is contained in:
Philipp Kunz 2022-03-16 11:35:25 +01:00
parent 96168fd870
commit 1b4681c065

View File

@ -5,7 +5,7 @@ import * as plugins from './smartpath.plugins.js';
* ------------------------------------------ */
// checks a file
let makeAbsolute = function (localPathArg: string, baseArg?: string): string {
export const makeAbsolute = (localPathArg: string, baseArg?: string): string => {
let absolutePath: string;
let alreadyAbsolute = plugins.path.isAbsolute(localPathArg);
if (baseArg && !alreadyAbsolute) {
@ -21,7 +21,7 @@ let makeAbsolute = function (localPathArg: string, baseArg?: string): string {
/* ------------------------------------------ *
* ------- export functions ----------------- *
* ------------------------------------------ */
export let toAbsolute = function (relativeArg: string | string[], baseArg?: string): any {
export const toAbsolute = (relativeArg: string | string[], baseArg?: string): string | string[] => {
if (typeof relativeArg === 'string') {
return makeAbsolute(relativeArg, baseArg);
} else if (Array.isArray(relativeArg)) {
@ -36,6 +36,6 @@ export let toAbsolute = function (relativeArg: string | string[], baseArg?: stri
'smartpath.absolute() could not make sense of the input. ' +
'Input is neither String nor Array'
);
return false;
return null;
}
};