fix(core): update
This commit is contained in:
parent
b51ccda39e
commit
fad06e3c33
@ -119,6 +119,6 @@ jobs:
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @gitzone/tsdoc
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
||||
|
@ -125,7 +125,7 @@ pages:
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci command npm install -g @git.zone/tsdoc
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
|
10
package.json
10
package.json
@ -27,11 +27,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/smartpath",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@pushrocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.4.1"
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsrun": "^1.2.44",
|
||||
"@git.zone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.12.7"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
2505
pnpm-lock.yaml
generated
2505
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import { tap, expect, expectAsync } from '@pushrocks/tapbundle';
|
||||
import { tap, expect, expectAsync } from '@push.rocks/tapbundle';
|
||||
import * as smartpath from '../ts/index.js';
|
||||
|
||||
let mySmartpath: smartpath.Smartpath;
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartpath',
|
||||
version: '5.0.11',
|
||||
version: '5.0.12',
|
||||
description: 'offers smart ways to handle paths'
|
||||
}
|
||||
|
@ -4,13 +4,21 @@ import * as plugins from './smartpath.plugins.js';
|
||||
* ------------ helpers --------------------- *
|
||||
* ------------------------------------------ */
|
||||
|
||||
// checks a file
|
||||
/**
|
||||
* takes a path and makes it absolute
|
||||
* @param localPathArg
|
||||
* @param baseArg
|
||||
* @returns
|
||||
*/
|
||||
export const makeAbsolute = (localPathArg: string, baseArg?: string): string => {
|
||||
let absolutePath: string;
|
||||
let alreadyAbsolute = plugins.path.isAbsolute(localPathArg);
|
||||
if (baseArg && !alreadyAbsolute) {
|
||||
if (!alreadyAbsolute && baseArg && !baseArg.startsWith('.')) {
|
||||
absolutePath = plugins.path.join(baseArg, localPathArg);
|
||||
} else if (!alreadyAbsolute) {
|
||||
if (baseArg) {
|
||||
plugins.path.join(baseArg, localPathArg);
|
||||
}
|
||||
absolutePath = plugins.path.resolve(localPathArg);
|
||||
} else {
|
||||
absolutePath = localPathArg;
|
||||
@ -18,9 +26,9 @@ export const makeAbsolute = (localPathArg: string, baseArg?: string): string =>
|
||||
return absolutePath;
|
||||
};
|
||||
|
||||
/* ------------------------------------------ *
|
||||
* ------- export functions ----------------- *
|
||||
* ------------------------------------------ */
|
||||
/*
|
||||
* like makeAbsolute, but takes different complex contructs like arrays and objects
|
||||
*/
|
||||
export const toAbsolute = (relativeArg: string | string[], baseArg?: string): string | string[] => {
|
||||
if (typeof relativeArg === 'string') {
|
||||
return makeAbsolute(relativeArg, baseArg);
|
||||
|
Loading…
Reference in New Issue
Block a user