fix(core): update
This commit is contained in:
@@ -2,7 +2,8 @@ import * as plugins from './smartpath.plugins.js';
|
||||
export type TPathType = 'url' | 'local';
|
||||
|
||||
/**
|
||||
* returns the type of the given path. Can be "url" or "local"
|
||||
* returns the type of the given path.
|
||||
* Can be "url" or "local"
|
||||
*/
|
||||
export const type = (pathStringArg: string): TPathType => {
|
||||
const urlRegex = /http[s|\s]:\/\/.*/i;
|
||||
@@ -20,6 +21,10 @@ export const dirnameFromImportMetaUrl = (importMetaUrlArg: string) => {
|
||||
return plugins.path.dirname(plugins.url.fileURLToPath(importMetaUrlArg));
|
||||
};
|
||||
|
||||
export const dirname = (pathArg: string) => {
|
||||
return dirnameFromImportMetaUrl(pathArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns homedir as absolute path
|
||||
* @param pathArgument if a pathargument is given, ~ is being replaced with the homedir
|
||||
|
Reference in New Issue
Block a user