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
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user