fix(core): update

This commit is contained in:
2024-04-20 10:13:48 +02:00
parent b53d74cd55
commit bf6ed38083
4 changed files with 210 additions and 168 deletions

View File

@ -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.'
}

View File

@ -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