fix(core): update
This commit is contained in:
parent
96168fd870
commit
1b4681c065
@ -5,7 +5,7 @@ import * as plugins from './smartpath.plugins.js';
|
|||||||
* ------------------------------------------ */
|
* ------------------------------------------ */
|
||||||
|
|
||||||
// checks a file
|
// checks a file
|
||||||
let makeAbsolute = function (localPathArg: string, baseArg?: string): string {
|
export const makeAbsolute = (localPathArg: string, baseArg?: string): string => {
|
||||||
let absolutePath: string;
|
let absolutePath: string;
|
||||||
let alreadyAbsolute = plugins.path.isAbsolute(localPathArg);
|
let alreadyAbsolute = plugins.path.isAbsolute(localPathArg);
|
||||||
if (baseArg && !alreadyAbsolute) {
|
if (baseArg && !alreadyAbsolute) {
|
||||||
@ -21,7 +21,7 @@ let makeAbsolute = function (localPathArg: string, baseArg?: string): string {
|
|||||||
/* ------------------------------------------ *
|
/* ------------------------------------------ *
|
||||||
* ------- export functions ----------------- *
|
* ------- 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') {
|
if (typeof relativeArg === 'string') {
|
||||||
return makeAbsolute(relativeArg, baseArg);
|
return makeAbsolute(relativeArg, baseArg);
|
||||||
} else if (Array.isArray(relativeArg)) {
|
} 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. ' +
|
'smartpath.absolute() could not make sense of the input. ' +
|
||||||
'Input is neither String nor Array'
|
'Input is neither String nor Array'
|
||||||
);
|
);
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user