@stryke/path 0.22.0 → 0.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +735 -0
- package/README.md +28 -22
- package/dist/append-BWRdnlxE.cjs +1 -0
- package/dist/{append.d.ts → append-DfRQvWY6.d.cts} +7 -3
- package/dist/append-DfRQvWY6.d.cts.map +1 -0
- package/dist/append-tFFvRN-V.d.mts +38 -0
- package/dist/append-tFFvRN-V.d.mts.map +1 -0
- package/dist/append-xQ5toDGS.mjs +2 -0
- package/dist/append-xQ5toDGS.mjs.map +1 -0
- package/dist/append.cjs +1 -19
- package/dist/append.d.cts +2 -0
- package/dist/append.d.mts +2 -0
- package/dist/append.mjs +1 -1
- package/dist/asset-extensions-BFW_s97B.mjs +2 -0
- package/dist/asset-extensions-BFW_s97B.mjs.map +1 -0
- package/dist/{asset-extensions.d.ts → asset-extensions-D-_39huh.d.cts} +5 -1
- package/dist/asset-extensions-D-_39huh.d.cts.map +1 -0
- package/dist/asset-extensions-DNMkK37t.cjs +1 -0
- package/dist/asset-extensions-DlN384ac.d.mts +11 -0
- package/dist/asset-extensions-DlN384ac.d.mts.map +1 -0
- package/dist/asset-extensions.cjs +1 -7
- package/dist/asset-extensions.d.cts +2 -0
- package/dist/asset-extensions.d.mts +2 -0
- package/dist/asset-extensions.mjs +1 -1
- package/dist/correct-path-B0Y_kOkW.cjs +1 -0
- package/dist/{correct-path.d.ts → correct-path-CwHhpk6I.d.cts} +11 -7
- package/dist/correct-path-CwHhpk6I.d.cts.map +1 -0
- package/dist/correct-path-DmaZHNUF.mjs +2 -0
- package/dist/correct-path-DmaZHNUF.mjs.map +1 -0
- package/dist/correct-path-LC5QqYV-.d.mts +59 -0
- package/dist/correct-path-LC5QqYV-.d.mts.map +1 -0
- package/dist/correct-path.cjs +1 -75
- package/dist/correct-path.d.cts +2 -0
- package/dist/correct-path.d.mts +2 -0
- package/dist/correct-path.mjs +1 -1
- package/dist/{cwd.d.ts → cwd-Bt4NcS-v.d.cts} +5 -1
- package/dist/cwd-Bt4NcS-v.d.cts.map +1 -0
- package/dist/cwd-D66SsPHE.cjs +1 -0
- package/dist/cwd-Dx53cgUn.d.mts +13 -0
- package/dist/cwd-Dx53cgUn.d.mts.map +1 -0
- package/dist/cwd-DxrPG9WB.mjs +2 -0
- package/dist/cwd-DxrPG9WB.mjs.map +1 -0
- package/dist/cwd.cjs +1 -9
- package/dist/cwd.d.cts +2 -0
- package/dist/cwd.d.mts +2 -0
- package/dist/cwd.mjs +1 -1
- package/dist/delimiter-B3nWo9Xn.mjs +2 -0
- package/dist/delimiter-B3nWo9Xn.mjs.map +1 -0
- package/dist/delimiter-BwyCEwu9.d.cts +22 -0
- package/dist/delimiter-BwyCEwu9.d.cts.map +1 -0
- package/dist/delimiter-DuDX7fvN.d.mts +22 -0
- package/dist/delimiter-DuDX7fvN.d.mts.map +1 -0
- package/dist/delimiter-IA9U4fxC.cjs +1 -0
- package/dist/delimiter.cjs +1 -18
- package/dist/delimiter.d.cts +2 -0
- package/dist/delimiter.d.mts +2 -0
- package/dist/delimiter.mjs +1 -1
- package/dist/file-path-fns-B9hKjfA-.cjs +1 -0
- package/dist/{file-path-fns.d.ts → file-path-fns-BKbfZRTB.d.mts} +44 -40
- package/dist/file-path-fns-BKbfZRTB.d.mts.map +1 -0
- package/dist/file-path-fns-CTLJP4j9.d.cts +218 -0
- package/dist/file-path-fns-CTLJP4j9.d.cts.map +1 -0
- package/dist/file-path-fns-MRI3PV8K.mjs +2 -0
- package/dist/file-path-fns-MRI3PV8K.mjs.map +1 -0
- package/dist/file-path-fns.cjs +1 -151
- package/dist/file-path-fns.d.cts +2 -0
- package/dist/file-path-fns.d.mts +2 -0
- package/dist/file-path-fns.mjs +1 -1
- package/dist/find.cjs +1 -16
- package/dist/find.d.cts +2 -0
- package/dist/find.d.mts +2 -0
- package/dist/find.mjs +1 -1
- package/dist/index.cjs +1 -148
- package/dist/index.d.cts +14 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.mjs +1 -1
- package/dist/{is-parent-path.d.ts → is-parent-path-B1EPPZ08.d.cts} +5 -1
- package/dist/is-parent-path-B1EPPZ08.d.cts.map +1 -0
- package/dist/is-parent-path-BW6CsB2o.d.mts +26 -0
- package/dist/is-parent-path-BW6CsB2o.d.mts.map +1 -0
- package/dist/is-parent-path-C0Azmjnd.mjs +2 -0
- package/dist/is-parent-path-C0Azmjnd.mjs.map +1 -0
- package/dist/is-parent-path-ChIi6oAO.cjs +1 -0
- package/dist/is-parent-path.cjs +1 -12
- package/dist/is-parent-path.d.cts +2 -0
- package/dist/is-parent-path.d.mts +2 -0
- package/dist/is-parent-path.mjs +1 -1
- package/dist/is-root-dir-BzQKuwi2.cjs +1 -0
- package/dist/{is-root-dir.d.ts → is-root-dir-CQA1qNI-.d.mts} +5 -1
- package/dist/is-root-dir-CQA1qNI-.d.mts.map +1 -0
- package/dist/is-root-dir-DI5qcnLw.mjs +2 -0
- package/dist/is-root-dir-DI5qcnLw.mjs.map +1 -0
- package/dist/is-root-dir-DnWZlIgB.d.cts +11 -0
- package/dist/is-root-dir-DnWZlIgB.d.cts.map +1 -0
- package/dist/is-root-dir.cjs +1 -9
- package/dist/is-root-dir.d.cts +2 -0
- package/dist/is-root-dir.d.mts +2 -0
- package/dist/is-root-dir.mjs +1 -1
- package/dist/is-type.cjs +1 -31
- package/dist/{is-type.d.ts → is-type.d.cts} +10 -6
- package/dist/is-type.d.cts.map +1 -0
- package/dist/is-type.d.mts +72 -0
- package/dist/is-type.d.mts.map +1 -0
- package/dist/is-type.mjs +1 -1
- package/dist/join-paths-BLjJ0GmK.mjs +2 -0
- package/dist/join-paths-BLjJ0GmK.mjs.map +1 -0
- package/dist/{join-paths.d.ts → join-paths-Bklwf_Bh.d.mts} +6 -2
- package/dist/join-paths-Bklwf_Bh.d.mts.map +1 -0
- package/dist/join-paths-DBTcCEw0.d.cts +13 -0
- package/dist/join-paths-DBTcCEw0.d.cts.map +1 -0
- package/dist/join-paths-hCBPtGlC.cjs +1 -0
- package/dist/join-paths.cjs +1 -60
- package/dist/join-paths.d.cts +2 -0
- package/dist/join-paths.d.mts +2 -0
- package/dist/join-paths.mjs +1 -1
- package/dist/join.cjs +1 -16
- package/dist/join.d.cts +2 -0
- package/dist/join.d.mts +2 -0
- package/dist/join.mjs +1 -1
- package/dist/normalize.cjs +1 -16
- package/dist/normalize.d.cts +2 -0
- package/dist/normalize.d.mts +2 -0
- package/dist/normalize.mjs +1 -1
- package/dist/regex-BEjSq2wo.cjs +1 -0
- package/dist/regex-DHvK8l1E.d.cts +12 -0
- package/dist/regex-DHvK8l1E.d.cts.map +1 -0
- package/dist/regex-fq9t8ABF.d.mts +12 -0
- package/dist/regex-fq9t8ABF.d.mts.map +1 -0
- package/dist/regex-hMUNHeGK.mjs +2 -0
- package/dist/regex-hMUNHeGK.mjs.map +1 -0
- package/dist/regex.cjs +1 -14
- package/dist/regex.d.cts +2 -0
- package/dist/regex.d.mts +2 -0
- package/dist/regex.mjs +1 -1
- package/dist/{replace.d.ts → replace-0nP9MPWp.d.cts} +6 -2
- package/dist/replace-0nP9MPWp.d.cts.map +1 -0
- package/dist/replace-C570sho0.cjs +1 -0
- package/dist/replace-C9dh7bEG.mjs +2 -0
- package/dist/replace-C9dh7bEG.mjs.map +1 -0
- package/dist/replace-fEEM12P3.d.mts +34 -0
- package/dist/replace-fEEM12P3.d.mts.map +1 -0
- package/dist/replace.cjs +1 -17
- package/dist/replace.d.cts +2 -0
- package/dist/replace.d.mts +2 -0
- package/dist/replace.mjs +1 -1
- package/dist/resolve-parent-path-5B4YvR_k.mjs +2 -0
- package/dist/resolve-parent-path-5B4YvR_k.mjs.map +1 -0
- package/dist/resolve-parent-path-D5uwbjqj.d.mts +12 -0
- package/dist/resolve-parent-path-D5uwbjqj.d.mts.map +1 -0
- package/dist/resolve-parent-path-DIrSH2oN.cjs +1 -0
- package/dist/resolve-parent-path-oZQZf2nw.d.cts +12 -0
- package/dist/resolve-parent-path-oZQZf2nw.d.cts.map +1 -0
- package/dist/resolve-parent-path.cjs +1 -13
- package/dist/resolve-parent-path.d.cts +2 -0
- package/dist/resolve-parent-path.d.mts +2 -0
- package/dist/resolve-parent-path.mjs +1 -1
- package/dist/slash-C7xRDucF.mjs +2 -0
- package/dist/slash-C7xRDucF.mjs.map +1 -0
- package/dist/{slash.d.ts → slash-CuA7ERRf.d.mts} +6 -2
- package/dist/slash-CuA7ERRf.d.mts.map +1 -0
- package/dist/slash-DPd6cWOz.d.cts +18 -0
- package/dist/slash-DPd6cWOz.d.cts.map +1 -0
- package/dist/slash-DhzW1Om-.cjs +1 -0
- package/dist/slash.cjs +1 -15
- package/dist/slash.d.cts +2 -0
- package/dist/slash.d.mts +2 -0
- package/dist/slash.mjs +1 -1
- package/package.json +55 -258
- package/dist/delimiter.d.ts +0 -18
- package/dist/find.d.ts +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/join.d.ts +0 -1
- package/dist/normalize.d.ts +0 -1
- package/dist/regex.d.ts +0 -8
- package/dist/resolve-parent-path.d.ts +0 -8
package/dist/cwd.d.cts
ADDED
package/dist/cwd.d.mts
ADDED
package/dist/cwd.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{t as e}from"./cwd-DxrPG9WB.mjs";export{e as cwd};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delimiter-B3nWo9Xn.mjs","names":["delimiter: \";\" | \":\""],"sources":["../src/delimiter.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * The platform-specific file delimiter.\n *\n * Equals to `\";\"` in windows and `\":\"` in all other platforms.\n */\nexport const delimiter: \";\" | \":\" = /* @__PURE__ */ (() =>\n process?.platform === \"win32\" ? \";\" : \":\")();\n\n// Mix namespaces without side-effects of object to allow tree-shaking\n\nconst platforms = {\n posix: undefined,\n win32: undefined\n} as unknown as {\n posix: any;\n win32: any;\n};\n\nconst mix = (del: \";\" | \":\" = delimiter) => {\n return new Proxy(\n {},\n {\n get(_, prop) {\n if (prop === \"delimiter\") {\n return del;\n }\n if (prop === \"posix\") {\n // eslint-disable-next-line ts/no-use-before-define\n return posix;\n }\n if (prop === \"win32\") {\n // eslint-disable-next-line ts/no-use-before-define\n return win32;\n }\n return platforms[prop as keyof typeof platforms];\n }\n }\n ) as unknown as typeof platforms & { delimiter: typeof del };\n};\n\nexport const posix = /* @__PURE__ */ mix(\":\");\n\nexport const win32 = /* @__PURE__ */ mix(\";\");\n"],"mappings":"AAuBA,MAAaA,OACX,SAAS,WAAa,QAAU,IAAM,MAAM,CAIxC,EAAY,CAChB,MAAO,IAAA,GACP,MAAO,IAAA,GACR,CAKK,GAAO,EAAiB,IACrB,IAAI,MACT,EAAE,CACF,CACE,IAAI,EAAG,EAAM,CAYX,OAXI,IAAS,YACJ,EAEL,IAAS,QAEJ,EAEL,IAAS,QAEJ,EAEF,EAAU,IAEpB,CACF,CAGU,EAAwB,EAAI,IAAI,CAEhC,EAAwB,EAAI,IAAI"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/delimiter.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The platform-specific file delimiter.
|
|
4
|
+
*
|
|
5
|
+
* Equals to `";"` in windows and `":"` in all other platforms.
|
|
6
|
+
*/
|
|
7
|
+
declare const delimiter: ";" | ":";
|
|
8
|
+
declare const posix: {
|
|
9
|
+
posix: any;
|
|
10
|
+
win32: any;
|
|
11
|
+
} & {
|
|
12
|
+
delimiter: ";" | ":";
|
|
13
|
+
};
|
|
14
|
+
declare const win32: {
|
|
15
|
+
posix: any;
|
|
16
|
+
win32: any;
|
|
17
|
+
} & {
|
|
18
|
+
delimiter: ";" | ":";
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { posix as n, win32 as r, delimiter as t };
|
|
22
|
+
//# sourceMappingURL=delimiter-BwyCEwu9.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delimiter-BwyCEwu9.d.cts","names":[],"sources":["../src/delimiter.ts"],"sourcesContent":[],"mappings":";;AAuBA;AAmCA;AAEA;;cArCa;cAmCA;;;;;;cAEA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/delimiter.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The platform-specific file delimiter.
|
|
4
|
+
*
|
|
5
|
+
* Equals to `";"` in windows and `":"` in all other platforms.
|
|
6
|
+
*/
|
|
7
|
+
declare const delimiter: ";" | ":";
|
|
8
|
+
declare const posix: {
|
|
9
|
+
posix: any;
|
|
10
|
+
win32: any;
|
|
11
|
+
} & {
|
|
12
|
+
delimiter: ";" | ":";
|
|
13
|
+
};
|
|
14
|
+
declare const win32: {
|
|
15
|
+
posix: any;
|
|
16
|
+
win32: any;
|
|
17
|
+
} & {
|
|
18
|
+
delimiter: ";" | ":";
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { posix as n, win32 as r, delimiter as t };
|
|
22
|
+
//# sourceMappingURL=delimiter-DuDX7fvN.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delimiter-DuDX7fvN.d.mts","names":[],"sources":["../src/delimiter.ts"],"sourcesContent":[],"mappings":";;AAuBA;AAmCA;AAEA;;cArCa;cAmCA;;;;;;cAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=(()=>process?.platform===`win32`?`;`:`:`)(),t={posix:void 0,win32:void 0},n=(n=e)=>new Proxy({},{get(e,a){return a===`delimiter`?n:a===`posix`?r:a===`win32`?i:t[a]}}),r=n(`:`),i=n(`;`);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
package/dist/delimiter.cjs
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.win32 = exports.posix = exports.delimiter = void 0;
|
|
7
|
-
const delimiter = exports.delimiter = process?.platform === "win32" ? ";" : ":";
|
|
8
|
-
const i = {
|
|
9
|
-
posix: void 0,
|
|
10
|
-
win32: void 0
|
|
11
|
-
},
|
|
12
|
-
e = (t = delimiter) => new Proxy({}, {
|
|
13
|
-
get(o, n) {
|
|
14
|
-
return n === "delimiter" ? t : n === "posix" ? posix : n === "win32" ? win32 : i[n];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
const posix = exports.posix = e(":"),
|
|
18
|
-
win32 = exports.win32 = e(";");
|
|
1
|
+
const e=require(`./delimiter-IA9U4fxC.cjs`);exports.delimiter=e.t,exports.posix=e.n,exports.win32=e.r;
|
package/dist/delimiter.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{n as e,r as t,t as n}from"./delimiter-B3nWo9Xn.mjs";export{n as delimiter,e as posix,t as win32};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./cwd-D66SsPHE.cjs`),t=require(`./regex-BEjSq2wo.cjs`),n=require(`./slash-DhzW1Om-.cjs`),r=require(`./join-paths-hCBPtGlC.cjs`),i=require(`./correct-path-B0Y_kOkW.cjs`),a=e=>{try{return e===null}catch{return!1}},o=e=>e===void 0,s=e=>{try{return o(e)||a(e)}catch{return!1}},c=e=>{try{return!s(e)}catch{return!1}},l=e=>{try{return typeof e==`string`}catch{return!1}},u=e=>{try{return c(e)&&l(e)&&e.length>0}catch{return!1}},d=``;function f(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,a=i.r(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!a.includes(`.`)?``:r===!1&&a.includes(`.`)?a.replace(`.${_(a)??``}`,``)||``:a}function p(e,t={}){let n=i.r(e),r=n.replace(f(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}const m=p;function h(e,t){let n=p(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}const g=h;function _(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.i.exec(i.r(e));return n&&n.length>0&&u(n[0])?n[0].replace(`.`,``):void 0}const v=_;function y(e){let t=_(e);return t?`.${t}`:void 0}function b(e){return _(e)??``}function x(e){let t=_(e);return t?`.${t}`:``}function S(e){return!!f(e)}function C(e){return!!p(e)}function w(e){return!!h(e)}function T(e){return!!_(e)}function E(t,a=e.t()){let o=i.r(t).split(`/`),s=``,c=!1;for(let e=o.length-1;e>=-1&&!c;e--){let t=e>=0?o[e]:a;!t||t.length===0||(s=r.n(t,s),c=n.i(t))}return s=i.n(s,!c),c&&!n.i(s)?`/${s}`:s.length>0?s:`.`}function D(...t){t=t.map(e=>i.r(e));let r=``,a=!1;for(let i=t.length-1;i>=-1&&!a;i--){let o=i>=0?t[i]:e.t();!o||o.length===0||(r=`${o}/${r}`,a=n.r(o))}return r=i.n(r,!a),a&&!n.r(r)?`/${r}`:r.length>0?r:`.`}function O(...e){return E(r.n(...e.map(e=>i.r(e))))}function k(e,n){let r=D(e).replace(t.s,`$1`).split(`/`),i=D(n).replace(t.s,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function A(e,t,n=!1){return k(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}function j(t){return A(t,e.t())}function M(e){let t=/^[/\\]|^[a-z]:[/\\]/i.exec(e)?.[0]?.replace(/\\/g,`/`)||``,r=i.r(e),a=r.replace(/\/$/,``).split(`/`).slice(0,-1);a.length===1&&/^[A-Z]:$/i.test(a[0])&&(a[0]+=`/`);let o=h(r),s=a.join(`/`)||(n.i(e)?`/`:`.`),c=b(e);return{root:t,dir:s,base:o,ext:c,name:o.slice(0,o.length-c.length)}}function N(e,t){let n=M(e);return r.n(n.dir,t.includes(`.`)?t:t+n.ext)}Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return N}});
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
//#region src/file-path-fns.d.ts
|
|
2
|
+
interface FindFileNameOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Require the file extension to be present in the file name.
|
|
5
|
+
*
|
|
6
|
+
* @defaultValue false
|
|
7
|
+
*/
|
|
8
|
+
requireExtension?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Return the file extension as part of the full file name result.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
withExtension?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Find the file name from a file path.
|
|
@@ -25,7 +26,7 @@ export interface FindFileNameOptions {
|
|
|
25
26
|
* @param options - Options to control the file name extraction
|
|
26
27
|
* @returns The file name
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
declare function findFileName(filePath: string, options?: FindFileNameOptions): string;
|
|
29
30
|
/**
|
|
30
31
|
* Find the full file path's directories from a file path.
|
|
31
32
|
*
|
|
@@ -42,8 +43,8 @@ export declare function findFileName(filePath: string, options?: FindFileNameOpt
|
|
|
42
43
|
* @param options - Options to control the file name extraction
|
|
43
44
|
* @returns The full file path's directories
|
|
44
45
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
declare function findFilePath(filePath: string, options?: FindFileNameOptions): string;
|
|
47
|
+
declare const dirname: typeof findFilePath;
|
|
47
48
|
/**
|
|
48
49
|
* Find the top most folder containing the file from a file path.
|
|
49
50
|
*
|
|
@@ -59,8 +60,8 @@ export declare const dirname: typeof findFilePath;
|
|
|
59
60
|
* @param options - Options to control the file name extraction
|
|
60
61
|
* @returns The folder containing the file
|
|
61
62
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
declare function findFolderName(filePath: string, options?: FindFileNameOptions): string;
|
|
64
|
+
declare const basename: typeof findFolderName;
|
|
64
65
|
/**
|
|
65
66
|
* Find the file extension from a file path.
|
|
66
67
|
*
|
|
@@ -79,8 +80,8 @@ export declare const basename: typeof findFolderName;
|
|
|
79
80
|
* @param filePath - The file path to process
|
|
80
81
|
* @returns The file extension or undefined if no extension is found
|
|
81
82
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
declare function findFileExtension(filePath: string): string | undefined;
|
|
84
|
+
declare const extname: typeof findFileExtension;
|
|
84
85
|
/**
|
|
85
86
|
* Find the file extension including the `"."` character prefix from a file path.
|
|
86
87
|
*
|
|
@@ -92,7 +93,7 @@ export declare const extname: typeof findFileExtension;
|
|
|
92
93
|
* @param filePath - The file path to process
|
|
93
94
|
* @returns The file extension (including the `"."` prefix) or undefined if no extension is found
|
|
94
95
|
*/
|
|
95
|
-
|
|
96
|
+
declare function findFileDotExtension(filePath: string): string | undefined;
|
|
96
97
|
/**
|
|
97
98
|
* Find the file extension from a file path or an empty string.
|
|
98
99
|
*
|
|
@@ -104,7 +105,7 @@ export declare function findFileDotExtension(filePath: string): string | undefin
|
|
|
104
105
|
* @param filePath - The file path to process
|
|
105
106
|
* @returns The file extension or an empty string if no extension is found
|
|
106
107
|
*/
|
|
107
|
-
|
|
108
|
+
declare function findFileExtensionSafe(filePath: string): string;
|
|
108
109
|
/**
|
|
109
110
|
* Find the file extension including the `"."` character prefix from a file path or an empty string.
|
|
110
111
|
*
|
|
@@ -116,35 +117,35 @@ export declare function findFileExtensionSafe(filePath: string): string;
|
|
|
116
117
|
* @param filePath - The file path to process
|
|
117
118
|
* @returns The file extension (including the `"."` prefix) or an empty string if no extension is found
|
|
118
119
|
*/
|
|
119
|
-
|
|
120
|
+
declare function findFileDotExtensionSafe(filePath: string): string;
|
|
120
121
|
/**
|
|
121
122
|
* Check if a file path has a file name.
|
|
122
123
|
*
|
|
123
124
|
* @param filePath - The file path to process
|
|
124
125
|
* @returns An indicator specifying if the file path has a file name
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
declare function hasFileName(filePath: string): boolean;
|
|
127
128
|
/**
|
|
128
129
|
* Check if a file path has a file path.
|
|
129
130
|
*
|
|
130
131
|
* @param filePath - The file path to process
|
|
131
132
|
* @returns An indicator specifying if the file path has a file path
|
|
132
133
|
*/
|
|
133
|
-
|
|
134
|
+
declare function hasFilePath(filePath: string): boolean;
|
|
134
135
|
/**
|
|
135
136
|
* Check if a file path has a folder name.
|
|
136
137
|
*
|
|
137
138
|
* @param filePath - The file path to process
|
|
138
139
|
* @returns An indicator specifying if the file path has a folder name
|
|
139
140
|
*/
|
|
140
|
-
|
|
141
|
+
declare function hasFolderName(filePath: string): boolean;
|
|
141
142
|
/**
|
|
142
143
|
* Check if a file path has a file extension.
|
|
143
144
|
*
|
|
144
145
|
* @param filePath - The file path to process
|
|
145
146
|
* @returns An indicator specifying if the file path has a file extension
|
|
146
147
|
*/
|
|
147
|
-
|
|
148
|
+
declare function hasFileExtension(filePath: string): boolean;
|
|
148
149
|
/**
|
|
149
150
|
* Resolve the file path to an absolute path.
|
|
150
151
|
*
|
|
@@ -152,15 +153,15 @@ export declare function hasFileExtension(filePath: string): boolean;
|
|
|
152
153
|
* @param cwd - The current working directory
|
|
153
154
|
* @returns The resolved path
|
|
154
155
|
*/
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
declare function resolvePath(path: string, cwd?: string): string;
|
|
157
|
+
declare function resolve(...paths: string[]): string;
|
|
157
158
|
/**
|
|
158
159
|
* Resolve the file path to an absolute path.
|
|
159
160
|
*
|
|
160
161
|
* @param paths - The paths to resolve
|
|
161
162
|
* @returns The resolved path
|
|
162
163
|
*/
|
|
163
|
-
|
|
164
|
+
declare function resolvePaths(...paths: string[]): string;
|
|
164
165
|
/**
|
|
165
166
|
* Get the relative path from one file to another.
|
|
166
167
|
*
|
|
@@ -171,7 +172,7 @@ export declare function resolvePaths(...paths: string[]): string;
|
|
|
171
172
|
* @param to - The target path to resolve relative to the base path
|
|
172
173
|
* @returns The relative path from the base path to the target path
|
|
173
174
|
*/
|
|
174
|
-
|
|
175
|
+
declare function relative(from: string, to: string): string;
|
|
175
176
|
/**
|
|
176
177
|
* Get the relative path from one file to another.
|
|
177
178
|
*
|
|
@@ -183,26 +184,26 @@ export declare function relative(from: string, to: string): string;
|
|
|
183
184
|
* @param withEndSlash - Whether to include a trailing slash at the end of the path
|
|
184
185
|
* @returns The relative path from the base path to the target path
|
|
185
186
|
*/
|
|
186
|
-
|
|
187
|
+
declare function relativePath(from: string, to: string, withEndSlash?: boolean): string;
|
|
187
188
|
/**
|
|
188
189
|
* Find the file path relative to the workspace root path.
|
|
189
190
|
*
|
|
190
191
|
* @param filePath - The file path to process
|
|
191
192
|
* @returns The resolved file path
|
|
192
193
|
*/
|
|
193
|
-
|
|
194
|
+
declare function relativeToCurrentDir(filePath: string): string;
|
|
194
195
|
/**
|
|
195
196
|
* Check if the path is a relative path.
|
|
196
197
|
*
|
|
197
198
|
* @param path - The path to check
|
|
198
199
|
* @returns An indicator specifying if the path is a relative path
|
|
199
200
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
declare function parsePath(path: string): {
|
|
202
|
+
root: string;
|
|
203
|
+
dir: string;
|
|
204
|
+
base: string;
|
|
205
|
+
ext: string;
|
|
206
|
+
name: string;
|
|
206
207
|
};
|
|
207
208
|
/**
|
|
208
209
|
* Rename the file name with a new name.
|
|
@@ -211,4 +212,7 @@ export declare function parsePath(path: string): {
|
|
|
211
212
|
* @param newFileName - The updated file name being processed
|
|
212
213
|
* @returns The modified or unmodified file path.
|
|
213
214
|
*/
|
|
214
|
-
|
|
215
|
+
declare function renameFile(filePath: string, newFileName: string): string;
|
|
216
|
+
//#endregion
|
|
217
|
+
export { resolvePaths as C, resolvePath as S, relative as _, findFileDotExtension as a, renameFile as b, findFileExtensionSafe as c, findFolderName as d, hasFileExtension as f, parsePath as g, hasFolderName as h, extname as i, findFileName as l, hasFilePath as m, basename as n, findFileDotExtensionSafe as o, hasFileName as p, dirname as r, findFileExtension as s, FindFileNameOptions as t, findFilePath as u, relativePath as v, resolve as x, relativeToCurrentDir as y };
|
|
218
|
+
//# sourceMappingURL=file-path-fns-BKbfZRTB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path-fns-BKbfZRTB.d.mts","names":[],"sources":["../src/file-path-fns.ts"],"sourcesContent":[],"mappings":";UA0BiB,mBAAA;EAAA;AA6BjB;AAuCA;AAcA;AAiBA;EAyBa,gBAAyB,CAAA,EAAA,OAAjB;EAoBL;AAYhB;AAaA;AAiBA;AAeA;EAYgB,aAAA,CAAW,EAAA,OAAA;AAU3B;AAUA;AAUA;AAWA;AAoCA;AA0CA;AAgBA;AAsCA;AAaA;AAUA;AAgCA;;;;iBA5ZgB,YAAA,6BAEL;;;;;;;;;;;;;;;;;iBAqCK,YAAA,6BAEL;cAYE,gBAAO;;;;;;;;;;;;;;;;iBAiBJ,cAAA,6BAEJ;cAuBC,iBAAQ;;;;;;;;;;;;;;;;;;;iBAoBL,iBAAA;cAYH,gBAAO;;;;;;;;;;;;iBAaJ,oBAAA;;;;;;;;;;;;iBAiBA,qBAAA;;;;;;;;;;;;iBAeA,wBAAA;;;;;;;iBAYA,WAAA;;;;;;;iBAUA,WAAA;;;;;;;iBAUA,aAAA;;;;;;;iBAUA,gBAAA;;;;;;;;iBAWA,WAAA;iBAoCA,OAAA;;;;;;;iBA0CA,YAAA;;;;;;;;;;;iBAgBA,QAAA;;;;;;;;;;;;iBAsCA,YAAA;;;;;;;iBAaA,oBAAA;;;;;;;iBAUA,SAAA;;;;;;;;;;;;;;iBAgCA,UAAA"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
//#region src/file-path-fns.d.ts
|
|
2
|
+
interface FindFileNameOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Require the file extension to be present in the file name.
|
|
5
|
+
*
|
|
6
|
+
* @defaultValue false
|
|
7
|
+
*/
|
|
8
|
+
requireExtension?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Return the file extension as part of the full file name result.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue true
|
|
13
|
+
*/
|
|
14
|
+
withExtension?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Find the file name from a file path.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const fileName = findFileName("C:\\Users\\user\\Documents\\file.txt");
|
|
22
|
+
* // fileName = "file.txt"
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param filePath - The file path to process
|
|
26
|
+
* @param options - Options to control the file name extraction
|
|
27
|
+
* @returns The file name
|
|
28
|
+
*/
|
|
29
|
+
declare function findFileName(filePath: string, options?: FindFileNameOptions): string;
|
|
30
|
+
/**
|
|
31
|
+
* Find the full file path's directories from a file path.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* The functionality of this method is similar to the {@link path.dirname} function in Node's path module.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const folderPath = findFilePath("C:\\Users\\user\\Documents\\file.txt");
|
|
39
|
+
* // folderPath = "C:\\Users\\user\\Documents"
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param filePath - The file path to process
|
|
43
|
+
* @param options - Options to control the file name extraction
|
|
44
|
+
* @returns The full file path's directories
|
|
45
|
+
*/
|
|
46
|
+
declare function findFilePath(filePath: string, options?: FindFileNameOptions): string;
|
|
47
|
+
declare const dirname: typeof findFilePath;
|
|
48
|
+
/**
|
|
49
|
+
* Find the top most folder containing the file from a file path.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The functionality of this method is similar to the {@link path.basename} function in Node's path module.
|
|
53
|
+
* If you're looking for the full path of the folder (for example: `C:\\Users\\user\\Documents` instead of just `Documents`) containing the file, use {@link findFilePath} instead.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const folderPath = findFolderName("C:\\Users\\user\\Documents\\file.txt");
|
|
57
|
+
* // folderPath = "Documents"
|
|
58
|
+
*
|
|
59
|
+
* @param filePath - The file path to process
|
|
60
|
+
* @param options - Options to control the file name extraction
|
|
61
|
+
* @returns The folder containing the file
|
|
62
|
+
*/
|
|
63
|
+
declare function findFolderName(filePath: string, options?: FindFileNameOptions): string;
|
|
64
|
+
declare const basename: typeof findFolderName;
|
|
65
|
+
/**
|
|
66
|
+
* Find the file extension from a file path.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* The functionality of this method is similar to the {@link path.extname} function in Node's path module.
|
|
70
|
+
* The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
|
|
71
|
+
*
|
|
72
|
+
* The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* findFileExtension("C:\\Users\\user\\Documents\\file.config.ts");
|
|
77
|
+
* // Returns "ts"
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @param filePath - The file path to process
|
|
81
|
+
* @returns The file extension or undefined if no extension is found
|
|
82
|
+
*/
|
|
83
|
+
declare function findFileExtension(filePath: string): string | undefined;
|
|
84
|
+
declare const extname: typeof findFileExtension;
|
|
85
|
+
/**
|
|
86
|
+
* Find the file extension including the `"."` character prefix from a file path.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
|
|
90
|
+
*
|
|
91
|
+
* The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.
|
|
92
|
+
*
|
|
93
|
+
* @param filePath - The file path to process
|
|
94
|
+
* @returns The file extension (including the `"."` prefix) or undefined if no extension is found
|
|
95
|
+
*/
|
|
96
|
+
declare function findFileDotExtension(filePath: string): string | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Find the file extension from a file path or an empty string.
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* The file extension is the part of the file name that comes after the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
|
|
102
|
+
*
|
|
103
|
+
* The returned extension **will not** include the dot, for example `txt` or `js` instead of `.txt` or `.js`.
|
|
104
|
+
*
|
|
105
|
+
* @param filePath - The file path to process
|
|
106
|
+
* @returns The file extension or an empty string if no extension is found
|
|
107
|
+
*/
|
|
108
|
+
declare function findFileExtensionSafe(filePath: string): string;
|
|
109
|
+
/**
|
|
110
|
+
* Find the file extension including the `"."` character prefix from a file path or an empty string.
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* The file extension is the part of the file name that comes after (and including) the last dot (`.`) in the file name. If the file name does not contain a dot, or if it ends with a dot, this function will return `undefined`.
|
|
114
|
+
*
|
|
115
|
+
* The returned extension **will** include the dot, for example `.txt` or `.js` instead of `txt` or `js`.
|
|
116
|
+
*
|
|
117
|
+
* @param filePath - The file path to process
|
|
118
|
+
* @returns The file extension (including the `"."` prefix) or an empty string if no extension is found
|
|
119
|
+
*/
|
|
120
|
+
declare function findFileDotExtensionSafe(filePath: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* Check if a file path has a file name.
|
|
123
|
+
*
|
|
124
|
+
* @param filePath - The file path to process
|
|
125
|
+
* @returns An indicator specifying if the file path has a file name
|
|
126
|
+
*/
|
|
127
|
+
declare function hasFileName(filePath: string): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Check if a file path has a file path.
|
|
130
|
+
*
|
|
131
|
+
* @param filePath - The file path to process
|
|
132
|
+
* @returns An indicator specifying if the file path has a file path
|
|
133
|
+
*/
|
|
134
|
+
declare function hasFilePath(filePath: string): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Check if a file path has a folder name.
|
|
137
|
+
*
|
|
138
|
+
* @param filePath - The file path to process
|
|
139
|
+
* @returns An indicator specifying if the file path has a folder name
|
|
140
|
+
*/
|
|
141
|
+
declare function hasFolderName(filePath: string): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Check if a file path has a file extension.
|
|
144
|
+
*
|
|
145
|
+
* @param filePath - The file path to process
|
|
146
|
+
* @returns An indicator specifying if the file path has a file extension
|
|
147
|
+
*/
|
|
148
|
+
declare function hasFileExtension(filePath: string): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Resolve the file path to an absolute path.
|
|
151
|
+
*
|
|
152
|
+
* @param path - The path to resolve
|
|
153
|
+
* @param cwd - The current working directory
|
|
154
|
+
* @returns The resolved path
|
|
155
|
+
*/
|
|
156
|
+
declare function resolvePath(path: string, cwd?: string): string;
|
|
157
|
+
declare function resolve(...paths: string[]): string;
|
|
158
|
+
/**
|
|
159
|
+
* Resolve the file path to an absolute path.
|
|
160
|
+
*
|
|
161
|
+
* @param paths - The paths to resolve
|
|
162
|
+
* @returns The resolved path
|
|
163
|
+
*/
|
|
164
|
+
declare function resolvePaths(...paths: string[]): string;
|
|
165
|
+
/**
|
|
166
|
+
* Get the relative path from one file to another.
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* This function is similar to the `path.relative` function in Node's path module.
|
|
170
|
+
*
|
|
171
|
+
* @param from - The base path to start from
|
|
172
|
+
* @param to - The target path to resolve relative to the base path
|
|
173
|
+
* @returns The relative path from the base path to the target path
|
|
174
|
+
*/
|
|
175
|
+
declare function relative(from: string, to: string): string;
|
|
176
|
+
/**
|
|
177
|
+
* Get the relative path from one file to another.
|
|
178
|
+
*
|
|
179
|
+
* @remarks
|
|
180
|
+
* This function wraps the `path.relative` function in Node's path module.
|
|
181
|
+
*
|
|
182
|
+
* @param from - The base path to start from
|
|
183
|
+
* @param to - The target path to resolve relative to the base path
|
|
184
|
+
* @param withEndSlash - Whether to include a trailing slash at the end of the path
|
|
185
|
+
* @returns The relative path from the base path to the target path
|
|
186
|
+
*/
|
|
187
|
+
declare function relativePath(from: string, to: string, withEndSlash?: boolean): string;
|
|
188
|
+
/**
|
|
189
|
+
* Find the file path relative to the workspace root path.
|
|
190
|
+
*
|
|
191
|
+
* @param filePath - The file path to process
|
|
192
|
+
* @returns The resolved file path
|
|
193
|
+
*/
|
|
194
|
+
declare function relativeToCurrentDir(filePath: string): string;
|
|
195
|
+
/**
|
|
196
|
+
* Check if the path is a relative path.
|
|
197
|
+
*
|
|
198
|
+
* @param path - The path to check
|
|
199
|
+
* @returns An indicator specifying if the path is a relative path
|
|
200
|
+
*/
|
|
201
|
+
declare function parsePath(path: string): {
|
|
202
|
+
root: string;
|
|
203
|
+
dir: string;
|
|
204
|
+
base: string;
|
|
205
|
+
ext: string;
|
|
206
|
+
name: string;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Rename the file name with a new name.
|
|
210
|
+
*
|
|
211
|
+
* @param filePath - The current file path being processed
|
|
212
|
+
* @param newFileName - The updated file name being processed
|
|
213
|
+
* @returns The modified or unmodified file path.
|
|
214
|
+
*/
|
|
215
|
+
declare function renameFile(filePath: string, newFileName: string): string;
|
|
216
|
+
//#endregion
|
|
217
|
+
export { resolvePaths as C, resolvePath as S, relative as _, findFileDotExtension as a, renameFile as b, findFileExtensionSafe as c, findFolderName as d, hasFileExtension as f, parsePath as g, hasFolderName as h, extname as i, findFileName as l, hasFilePath as m, basename as n, findFileDotExtensionSafe as o, hasFileName as p, dirname as r, findFileExtension as s, FindFileNameOptions as t, findFilePath as u, relativePath as v, resolve as x, relativeToCurrentDir as y };
|
|
218
|
+
//# sourceMappingURL=file-path-fns-CTLJP4j9.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path-fns-CTLJP4j9.d.cts","names":[],"sources":["../src/file-path-fns.ts"],"sourcesContent":[],"mappings":";UA0BiB,mBAAA;EAAA;AA6BjB;AAuCA;AAcA;AAiBA;EAyBa,gBAAyB,CAAA,EAAA,OAAjB;EAoBL;AAYhB;AAaA;AAiBA;AAeA;EAYgB,aAAA,CAAW,EAAA,OAAA;AAU3B;AAUA;AAUA;AAWA;AAoCA;AA0CA;AAgBA;AAsCA;AAaA;AAUA;AAgCA;;;;iBA5ZgB,YAAA,6BAEL;;;;;;;;;;;;;;;;;iBAqCK,YAAA,6BAEL;cAYE,gBAAO;;;;;;;;;;;;;;;;iBAiBJ,cAAA,6BAEJ;cAuBC,iBAAQ;;;;;;;;;;;;;;;;;;;iBAoBL,iBAAA;cAYH,gBAAO;;;;;;;;;;;;iBAaJ,oBAAA;;;;;;;;;;;;iBAiBA,qBAAA;;;;;;;;;;;;iBAeA,wBAAA;;;;;;;iBAYA,WAAA;;;;;;;iBAUA,WAAA;;;;;;;iBAUA,aAAA;;;;;;;iBAUA,gBAAA;;;;;;;;iBAWA,WAAA;iBAoCA,OAAA;;;;;;;iBA0CA,YAAA;;;;;;;;;;;iBAgBA,QAAA;;;;;;;;;;;;iBAsCA,YAAA;;;;;;;iBAaA,oBAAA;;;;;;;iBAUA,SAAA;;;;;;;;;;;;;;iBAgCA,UAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./cwd-DxrPG9WB.mjs";import{i as t,s as n}from"./regex-hMUNHeGK.mjs";import{i as r,r as i}from"./slash-C7xRDucF.mjs";import{n as a}from"./join-paths-BLjJ0GmK.mjs";import{n as o,r as s}from"./correct-path-DmaZHNUF.mjs";const c=e=>{try{return e===null}catch{return!1}},l=e=>e===void 0,u=e=>{try{return l(e)||c(e)}catch{return!1}},d=e=>{try{return!u(e)}catch{return!1}},f=e=>{try{return typeof e==`string`}catch{return!1}},p=e=>{try{return d(e)&&f(e)&&e.length>0}catch{return!1}};function m(e,t={}){let{requireExtension:n=!1,withExtension:r=!0}=t,i=s(e)?.split(e?.includes(`\\`)?`\\`:`/`)?.pop()??``;return n===!0&&!i.includes(`.`)?``:r===!1&&i.includes(`.`)?i.replace(`.${y(i)??``}`,``)||``:i}function h(e,t={}){let n=s(e),r=n.replace(m(n,{requireExtension:!1,...t}),``);return r===`/`?r:r.replace(/\/$/,``)}const g=h;function _(e,t){let n=h(e,t).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return r??``}const v=_;function y(e){if(e.endsWith(`.`)||e.endsWith(`/`))return;let n=t.exec(s(e));return n&&n.length>0&&p(n[0])?n[0].replace(`.`,``):void 0}const b=y;function x(e){let t=y(e);return t?`.${t}`:void 0}function S(e){return y(e)??``}function C(e){let t=y(e);return t?`.${t}`:``}function w(e){return!!m(e)}function T(e){return!!h(e)}function E(e){return!!_(e)}function D(e){return!!y(e)}function O(t,n=e()){let i=s(t).split(`/`),c=``,l=!1;for(let e=i.length-1;e>=-1&&!l;e--){let t=e>=0?i[e]:n;!t||t.length===0||(c=a(t,c),l=r(t))}return c=o(c,!l),l&&!r(c)?`/${c}`:c.length>0?c:`.`}function k(...t){t=t.map(e=>s(e));let n=``,r=!1;for(let a=t.length-1;a>=-1&&!r;a--){let o=a>=0?t[a]:e();!o||o.length===0||(n=`${o}/${n}`,r=i(o))}return n=o(n,!r),r&&!i(n)?`/${n}`:n.length>0?n:`.`}function A(...e){return O(a(...e.map(e=>s(e))))}function j(e,t){let r=k(e).replace(n,`$1`).split(`/`),i=k(t).replace(n,`$1`).split(`/`);if(i[0][1]===`:`&&r[0][1]===`:`&&r[0]!==i[0])return i.join(`/`);let a=[...r];for(let e of a){if(i[0]!==e)break;r.shift(),i.shift()}return[...r.map(()=>`..`),...i].join(`/`)}function M(e,t,n=!1){return j(n===!0?e:e.replace(/\/$/,``),n===!0?t:t.replace(/\/$/,``))}function N(t){return M(t,e())}function P(e){let t=/^[/\\]|^[a-z]:[/\\]/i.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=s(e),i=n.replace(/\/$/,``).split(`/`).slice(0,-1);i.length===1&&/^[A-Z]:$/i.test(i[0])&&(i[0]+=`/`);let a=_(n),o=i.join(`/`)||(r(e)?`/`:`.`),c=S(e);return{root:t,dir:o,base:a,ext:c,name:a.slice(0,a.length-c.length)}}function F(e,t){let n=P(e);return a(n.dir,t.includes(`.`)?t:t+n.ext)}export{A as S,M as _,C as a,k as b,m as c,D as d,w as f,j as g,P as h,x as i,h as l,E as m,g as n,y as o,T as p,b as r,S as s,v as t,_ as u,N as v,O as x,F as y};
|
|
2
|
+
//# sourceMappingURL=file-path-fns-MRI3PV8K.mjs.map
|