fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartpath',
|
||||
version: '5.0.14',
|
||||
version: '5.0.15',
|
||||
description: 'A library offering smart ways to handle file and directory paths.'
|
||||
}
|
||||
|
@ -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