@stryke/path 0.26.18 â 0.27.0
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 +29 -0
- package/README.md +4 -3
- package/dist/common.cjs +34 -1
- package/dist/common.d.cts +27 -1
- package/dist/common.d.cts.map +1 -1
- package/dist/common.d.mts +27 -1
- package/dist/common.d.mts.map +1 -1
- package/dist/common.mjs +33 -2
- package/dist/common.mjs.map +1 -1
- package/dist/file-path-fns.cjs +1 -1
- package/dist/file-path-fns.mjs +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - Path
|
|
4
4
|
|
|
5
|
+
## [0.27.0](https://github.com/storm-software/stryke/releases/tag/path%400.27.0) (03/13/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Resolve issue with devenv profiles ([4a9cf7db](https://github.com/storm-software/stryke/commit/4a9cf7db))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **path:** Added the `findBasePath` helper utility ([12e6cd08](https://github.com/storm-software/stryke/commit/12e6cd08))
|
|
14
|
+
|
|
15
|
+
### Updated Dependencies
|
|
16
|
+
|
|
17
|
+
- Updated **type-checks** to **v0.5.39**
|
|
18
|
+
- Updated **convert** to **v0.6.54**
|
|
19
|
+
- Updated **types** to **v0.10.53**
|
|
20
|
+
|
|
21
|
+
## [0.26.19](https://github.com/storm-software/stryke/releases/tag/path%400.26.19) (03/11/2026)
|
|
22
|
+
|
|
23
|
+
### Miscellaneous
|
|
24
|
+
|
|
25
|
+
- **monorepo:** Run prettier on workspace packages' files ([dfe7ab3e](https://github.com/storm-software/stryke/commit/dfe7ab3e))
|
|
26
|
+
- **monorepo:** Format workspace source files ([a97707ea](https://github.com/storm-software/stryke/commit/a97707ea))
|
|
27
|
+
|
|
28
|
+
### Updated Dependencies
|
|
29
|
+
|
|
30
|
+
- Updated **type-checks** to **v0.5.38**
|
|
31
|
+
- Updated **convert** to **v0.6.53**
|
|
32
|
+
- Updated **types** to **v0.10.52**
|
|
33
|
+
|
|
5
34
|
## [0.26.18](https://github.com/storm-software/stryke/releases/tag/path%400.26.18) (03/11/2026)
|
|
6
35
|
|
|
7
36
|
### Updated Dependencies
|
package/README.md
CHANGED
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
<br />
|
|
25
|
-
This package is part of Storm Software's
|
|
25
|
+
This package is part of Storm Software's **đŠī¸ Stryke** monorepo. Stryke packages TypeScript utility packages with shared functionality common to many Storm Software applications.
|
|
26
26
|
|
|
27
27
|
<br />
|
|
28
28
|
|
|
29
29
|
<h3 align="center">đģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
30
30
|
|
|
31
|
-
[](https://github.com/storm-software/stryke) [](http://commitizen.github.io/cz-cli/)  
|
|
32
32
|
|
|
33
33
|
> [!IMPORTANT] Important
|
|
34
|
-
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and
|
|
34
|
+
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
35
35
|
|
|
36
36
|
<div align="center">
|
|
37
37
|
<a href="https://github.com/storm-software/stryke" target="_blank"><b>Be sure to â this repository on GitHub so you can keep up to date on any daily progress!</b></a>
|
|
@@ -53,6 +53,7 @@ NodeJs and browser environments.
|
|
|
53
53
|
|
|
54
54
|
<!-- START doctoc -->
|
|
55
55
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
56
|
+
|
|
56
57
|
## Table of Contents
|
|
57
58
|
|
|
58
59
|
- [Installing](#installing)
|
package/dist/common.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_slash = require('./slash.cjs');
|
|
2
|
+
const require_is_set_string = require('./type-checks/src/is-set-string.cjs');
|
|
2
3
|
const require_correct_path = require('./correct-path.cjs');
|
|
3
4
|
|
|
4
5
|
//#region src/common.ts
|
|
@@ -29,6 +30,38 @@ function commonPath(paths) {
|
|
|
29
30
|
}
|
|
30
31
|
return require_correct_path.withoutTrailingSlash(first.split("/").slice(0, endOfPrefix).join("/"));
|
|
31
32
|
}
|
|
33
|
+
const findCommonPath = commonPath;
|
|
34
|
+
/**
|
|
35
|
+
* Find the base path from a string path/glob or an array of string paths/globs. If a string is provided, it is returned as the base path. If an array of strings is provided, the common path among them is returned. If the input is invalid or empty, "/" is returned.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* findBasePath('/foo/bar/baz');
|
|
40
|
+
* // returns '/foo/bar/baz'
|
|
41
|
+
*
|
|
42
|
+
* findBasePath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
|
|
43
|
+
* // returns '/foo/bar'
|
|
44
|
+
*
|
|
45
|
+
* findBasePath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
|
|
46
|
+
* // returns 'C:/foo/bar'
|
|
47
|
+
*
|
|
48
|
+
* findBasePath(['foo/bar/**\/baz', 'foo/bar/qux/*', 'foo/bar/baz/quux']);
|
|
49
|
+
* // returns 'foo/bar'
|
|
50
|
+
*
|
|
51
|
+
* findBasePath([]);
|
|
52
|
+
* // returns '/'
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param paths - The string or array of strings to find the base path from
|
|
56
|
+
* @returns The base path
|
|
57
|
+
*/
|
|
58
|
+
function findBasePath(paths) {
|
|
59
|
+
if (require_is_set_string.isSetString(paths)) return paths;
|
|
60
|
+
else if (Array.isArray(paths) && paths.length > 0) return commonPath(paths.map((path) => require_correct_path.stripStars(path)));
|
|
61
|
+
return "/";
|
|
62
|
+
}
|
|
32
63
|
|
|
33
64
|
//#endregion
|
|
34
|
-
exports.commonPath = commonPath;
|
|
65
|
+
exports.commonPath = commonPath;
|
|
66
|
+
exports.findBasePath = findBasePath;
|
|
67
|
+
exports.findCommonPath = findCommonPath;
|
package/dist/common.d.cts
CHANGED
|
@@ -15,6 +15,32 @@
|
|
|
15
15
|
* @returns The common path
|
|
16
16
|
*/
|
|
17
17
|
declare function commonPath(paths: string[]): string;
|
|
18
|
+
declare const findCommonPath: typeof commonPath;
|
|
19
|
+
/**
|
|
20
|
+
* Find the base path from a string path/glob or an array of string paths/globs. If a string is provided, it is returned as the base path. If an array of strings is provided, the common path among them is returned. If the input is invalid or empty, "/" is returned.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* findBasePath('/foo/bar/baz');
|
|
25
|
+
* // returns '/foo/bar/baz'
|
|
26
|
+
*
|
|
27
|
+
* findBasePath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
|
|
28
|
+
* // returns '/foo/bar'
|
|
29
|
+
*
|
|
30
|
+
* findBasePath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
|
|
31
|
+
* // returns 'C:/foo/bar'
|
|
32
|
+
*
|
|
33
|
+
* findBasePath(['foo/bar/**\/baz', 'foo/bar/qux/*', 'foo/bar/baz/quux']);
|
|
34
|
+
* // returns 'foo/bar'
|
|
35
|
+
*
|
|
36
|
+
* findBasePath([]);
|
|
37
|
+
* // returns '/'
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param paths - The string or array of strings to find the base path from
|
|
41
|
+
* @returns The base path
|
|
42
|
+
*/
|
|
43
|
+
declare function findBasePath(paths: string | string[]): string;
|
|
18
44
|
//#endregion
|
|
19
|
-
export { commonPath };
|
|
45
|
+
export { commonPath, findBasePath, findCommonPath };
|
|
20
46
|
//# sourceMappingURL=common.d.cts.map
|
package/dist/common.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.cts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"common.d.cts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;AAqCA;AA4BA;AA0BA;;;;;;;;;;;;iBAtDgB,UAAA;cA4BH,uBAAc;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BX,YAAA"}
|
package/dist/common.d.mts
CHANGED
|
@@ -15,6 +15,32 @@
|
|
|
15
15
|
* @returns The common path
|
|
16
16
|
*/
|
|
17
17
|
declare function commonPath(paths: string[]): string;
|
|
18
|
+
declare const findCommonPath: typeof commonPath;
|
|
19
|
+
/**
|
|
20
|
+
* Find the base path from a string path/glob or an array of string paths/globs. If a string is provided, it is returned as the base path. If an array of strings is provided, the common path among them is returned. If the input is invalid or empty, "/" is returned.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* findBasePath('/foo/bar/baz');
|
|
25
|
+
* // returns '/foo/bar/baz'
|
|
26
|
+
*
|
|
27
|
+
* findBasePath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
|
|
28
|
+
* // returns '/foo/bar'
|
|
29
|
+
*
|
|
30
|
+
* findBasePath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
|
|
31
|
+
* // returns 'C:/foo/bar'
|
|
32
|
+
*
|
|
33
|
+
* findBasePath(['foo/bar/**\/baz', 'foo/bar/qux/*', 'foo/bar/baz/quux']);
|
|
34
|
+
* // returns 'foo/bar'
|
|
35
|
+
*
|
|
36
|
+
* findBasePath([]);
|
|
37
|
+
* // returns '/'
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param paths - The string or array of strings to find the base path from
|
|
41
|
+
* @returns The base path
|
|
42
|
+
*/
|
|
43
|
+
declare function findBasePath(paths: string | string[]): string;
|
|
18
44
|
//#endregion
|
|
19
|
-
export { commonPath };
|
|
45
|
+
export { commonPath, findBasePath, findCommonPath };
|
|
20
46
|
//# sourceMappingURL=common.d.mts.map
|
package/dist/common.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.mts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"common.d.mts","names":[],"sources":["../src/common.ts"],"sourcesContent":[],"mappings":";;AAqCA;AA4BA;AA0BA;;;;;;;;;;;;iBAtDgB,UAAA;cA4BH,uBAAc;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BX,YAAA"}
|
package/dist/common.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { slash } from "./slash.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { isSetString } from "./type-checks/src/is-set-string.mjs";
|
|
3
|
+
import { correctPath, stripStars, withoutTrailingSlash } from "./correct-path.mjs";
|
|
3
4
|
|
|
4
5
|
//#region src/common.ts
|
|
5
6
|
/**
|
|
@@ -29,7 +30,37 @@ function commonPath(paths) {
|
|
|
29
30
|
}
|
|
30
31
|
return withoutTrailingSlash(first.split("/").slice(0, endOfPrefix).join("/"));
|
|
31
32
|
}
|
|
33
|
+
const findCommonPath = commonPath;
|
|
34
|
+
/**
|
|
35
|
+
* Find the base path from a string path/glob or an array of string paths/globs. If a string is provided, it is returned as the base path. If an array of strings is provided, the common path among them is returned. If the input is invalid or empty, "/" is returned.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* findBasePath('/foo/bar/baz');
|
|
40
|
+
* // returns '/foo/bar/baz'
|
|
41
|
+
*
|
|
42
|
+
* findBasePath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);
|
|
43
|
+
* // returns '/foo/bar'
|
|
44
|
+
*
|
|
45
|
+
* findBasePath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);
|
|
46
|
+
* // returns 'C:/foo/bar'
|
|
47
|
+
*
|
|
48
|
+
* findBasePath(['foo/bar/**\/baz', 'foo/bar/qux/*', 'foo/bar/baz/quux']);
|
|
49
|
+
* // returns 'foo/bar'
|
|
50
|
+
*
|
|
51
|
+
* findBasePath([]);
|
|
52
|
+
* // returns '/'
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param paths - The string or array of strings to find the base path from
|
|
56
|
+
* @returns The base path
|
|
57
|
+
*/
|
|
58
|
+
function findBasePath(paths) {
|
|
59
|
+
if (isSetString(paths)) return paths;
|
|
60
|
+
else if (Array.isArray(paths) && paths.length > 0) return commonPath(paths.map((path) => stripStars(path)));
|
|
61
|
+
return "/";
|
|
62
|
+
}
|
|
32
63
|
|
|
33
64
|
//#endregion
|
|
34
|
-
export { commonPath };
|
|
65
|
+
export { commonPath, findBasePath, findCommonPath };
|
|
35
66
|
//# sourceMappingURL=common.mjs.map
|
package/dist/common.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","names":[],"sources":["../src/common.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\nimport { correctPath, withoutTrailingSlash } from \"./normalize\";\nimport { slash } from \"./slash\";\n\n/**\n * Get the common path from an array of paths\n *\n * @example\n * ```ts\n * commonPath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);\n * // returns '/foo/bar'\n *\n * commonPath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);\n * // returns 'C:/foo/bar'\n * ```\n *\n * @param paths - The array of paths\n * @returns The common path\n */\nexport function commonPath(paths: string[]): string {\n const [first = \"\", ...remaining] = paths.map(path =>\n correctPath(slash(path))\n );\n if (!first) {\n return \"\";\n }\n if (remaining.length === 0) {\n return first;\n }\n\n let endOfPrefix = first.split(\"/\").length;\n for (const path of remaining) {\n const compare = path.split(\"/\");\n for (let i = 0; i < endOfPrefix; i++) {\n if (compare[i] !== first.split(\"/\")[i]) {\n endOfPrefix = i;\n }\n }\n\n if (endOfPrefix === 0) {\n return \"\";\n }\n }\n\n return withoutTrailingSlash(first.split(\"/\").slice(0, endOfPrefix).join(\"/\"));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.mjs","names":[],"sources":["../src/common.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\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { correctPath, stripStars, withoutTrailingSlash } from \"./normalize\";\nimport { slash } from \"./slash\";\n\n/**\n * Get the common path from an array of paths\n *\n * @example\n * ```ts\n * commonPath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);\n * // returns '/foo/bar'\n *\n * commonPath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);\n * // returns 'C:/foo/bar'\n * ```\n *\n * @param paths - The array of paths\n * @returns The common path\n */\nexport function commonPath(paths: string[]): string {\n const [first = \"\", ...remaining] = paths.map(path =>\n correctPath(slash(path))\n );\n if (!first) {\n return \"\";\n }\n if (remaining.length === 0) {\n return first;\n }\n\n let endOfPrefix = first.split(\"/\").length;\n for (const path of remaining) {\n const compare = path.split(\"/\");\n for (let i = 0; i < endOfPrefix; i++) {\n if (compare[i] !== first.split(\"/\")[i]) {\n endOfPrefix = i;\n }\n }\n\n if (endOfPrefix === 0) {\n return \"\";\n }\n }\n\n return withoutTrailingSlash(first.split(\"/\").slice(0, endOfPrefix).join(\"/\"));\n}\n\nexport const findCommonPath = commonPath;\n\n/**\n * Find the base path from a string path/glob or an array of string paths/globs. If a string is provided, it is returned as the base path. If an array of strings is provided, the common path among them is returned. If the input is invalid or empty, \"/\" is returned.\n *\n * @example\n * ```ts\n * findBasePath('/foo/bar/baz');\n * // returns '/foo/bar/baz'\n *\n * findBasePath(['/foo/bar/baz', '/foo/bar/qux', '/foo/bar/baz/quux']);\n * // returns '/foo/bar'\n *\n * findBasePath(['C:/foo/bar/baz', 'C:/foo/bar/qux', 'C:/foo/bar/baz/quux']);\n * // returns 'C:/foo/bar'\n *\n * findBasePath(['foo/bar/**\\/baz', 'foo/bar/qux/*', 'foo/bar/baz/quux']);\n * // returns 'foo/bar'\n *\n * findBasePath([]);\n * // returns '/'\n * ```\n *\n * @param paths - The string or array of strings to find the base path from\n * @returns The base path\n */\nexport function findBasePath(paths: string | string[]): string {\n if (isSetString(paths)) {\n return paths;\n } else if (Array.isArray(paths) && paths.length > 0) {\n return commonPath(paths.map(path => stripStars(path)));\n }\n\n return \"/\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,WAAW,OAAyB;CAClD,MAAM,CAAC,QAAQ,IAAI,GAAG,aAAa,MAAM,KAAI,SAC3C,YAAY,MAAM,KAAK,CAAC,CACzB;AACD,KAAI,CAAC,MACH,QAAO;AAET,KAAI,UAAU,WAAW,EACvB,QAAO;CAGT,IAAI,cAAc,MAAM,MAAM,IAAI,CAAC;AACnC,MAAK,MAAM,QAAQ,WAAW;EAC5B,MAAM,UAAU,KAAK,MAAM,IAAI;AAC/B,OAAK,IAAI,IAAI,GAAG,IAAI,aAAa,IAC/B,KAAI,QAAQ,OAAO,MAAM,MAAM,IAAI,CAAC,GAClC,eAAc;AAIlB,MAAI,gBAAgB,EAClB,QAAO;;AAIX,QAAO,qBAAqB,MAAM,MAAM,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,KAAK,IAAI,CAAC;;AAG/E,MAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;AA0B9B,SAAgB,aAAa,OAAkC;AAC7D,KAAI,YAAY,MAAM,CACpB,QAAO;UACE,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EAChD,QAAO,WAAW,MAAM,KAAI,SAAQ,WAAW,KAAK,CAAC,CAAC;AAGxD,QAAO"}
|
package/dist/file-path-fns.cjs
CHANGED
|
@@ -3,8 +3,8 @@ const require_cwd = require('./cwd.cjs');
|
|
|
3
3
|
const require_regex = require('./regex.cjs');
|
|
4
4
|
const require_is_type = require('./is-type.cjs');
|
|
5
5
|
const require_join_paths = require('./join-paths.cjs');
|
|
6
|
-
const require_correct_path = require('./correct-path.cjs');
|
|
7
6
|
const require_is_set_string = require('./type-checks/src/is-set-string.cjs');
|
|
7
|
+
const require_correct_path = require('./correct-path.cjs');
|
|
8
8
|
const require_base = require('./types/src/base.cjs');
|
|
9
9
|
|
|
10
10
|
//#region src/file-path-fns.ts
|
package/dist/file-path-fns.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { cwd } from "./cwd.mjs";
|
|
|
2
2
|
import { FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, ROOT_FOLDER_REGEX } from "./regex.mjs";
|
|
3
3
|
import { isAbsolute, isAbsolutePath } from "./is-type.mjs";
|
|
4
4
|
import { joinPaths } from "./join-paths.mjs";
|
|
5
|
-
import { normalizeString, normalizeWindowsPath } from "./correct-path.mjs";
|
|
6
5
|
import { isSetString } from "./type-checks/src/is-set-string.mjs";
|
|
6
|
+
import { normalizeString, normalizeWindowsPath } from "./correct-path.mjs";
|
|
7
7
|
import { EMPTY_STRING } from "./types/src/base.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/file-path-fns.ts
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,8 @@ exports.cwd = require_cwd.cwd;
|
|
|
34
34
|
exports.delimiter = require_delimiter.delimiter;
|
|
35
35
|
exports.dirname = require_file_path_fns.dirname;
|
|
36
36
|
exports.extname = require_file_path_fns.extname;
|
|
37
|
+
exports.findBasePath = require_common.findBasePath;
|
|
38
|
+
exports.findCommonPath = require_common.findCommonPath;
|
|
37
39
|
exports.findFileDotExtension = require_file_path_fns.findFileDotExtension;
|
|
38
40
|
exports.findFileDotExtensionSafe = require_file_path_fns.findFileDotExtensionSafe;
|
|
39
41
|
exports.findFileExtension = require_file_path_fns.findFileExtension;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppendPathOptions, append, appendExtension, appendPath } from "./append.cjs";
|
|
2
2
|
import { DEFAULT_ASSET_EXTS } from "./asset-extensions.cjs";
|
|
3
|
-
import { commonPath } from "./common.cjs";
|
|
3
|
+
import { commonPath, findBasePath, findCommonPath } from "./common.cjs";
|
|
4
4
|
import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.cjs";
|
|
5
5
|
import { cwd } from "./cwd.cjs";
|
|
6
6
|
import { delimiter, posix, win32 } from "./delimiter.cjs";
|
|
@@ -13,4 +13,4 @@ import { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE
|
|
|
13
13
|
import { replaceExtension, replacePath } from "./replace.cjs";
|
|
14
14
|
import { resolveParentPath } from "./resolve-parent-path.cjs";
|
|
15
15
|
import { formatSlash, slash } from "./slash.cjs";
|
|
16
|
-
export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, FindFileExtensionOptions, FindFileNameOptions, GlobToRegexOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
|
16
|
+
export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, FindFileExtensionOptions, FindFileNameOptions, GlobToRegexOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findBasePath, findCommonPath, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppendPathOptions, append, appendExtension, appendPath } from "./append.mjs";
|
|
2
2
|
import { DEFAULT_ASSET_EXTS } from "./asset-extensions.mjs";
|
|
3
|
-
import { commonPath } from "./common.mjs";
|
|
3
|
+
import { commonPath, findBasePath, findCommonPath } from "./common.mjs";
|
|
4
4
|
import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.mjs";
|
|
5
5
|
import { cwd } from "./cwd.mjs";
|
|
6
6
|
import { delimiter, posix, win32 } from "./delimiter.mjs";
|
|
@@ -13,4 +13,4 @@ import { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE
|
|
|
13
13
|
import { replaceExtension, replacePath } from "./replace.mjs";
|
|
14
14
|
import { resolveParentPath } from "./resolve-parent-path.mjs";
|
|
15
15
|
import { formatSlash, slash } from "./slash.mjs";
|
|
16
|
-
export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, FindFileExtensionOptions, FindFileNameOptions, GlobToRegexOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
|
16
|
+
export { ABSOLUTE_PATH_REGEX, AppendPathOptions, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, FindFileExtensionOptions, FindFileNameOptions, GlobToRegexOptions, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findBasePath, findCommonPath, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join, joinPaths } from "./join-paths.mjs";
|
|
|
6
6
|
import { append, appendExtension, appendPath } from "./append.mjs";
|
|
7
7
|
import { DEFAULT_ASSET_EXTS } from "./asset-extensions.mjs";
|
|
8
8
|
import { correctPath, normalizeString, normalizeWindowsPath, stripStars, toAbsolutePath, toRelativePath, withTrailingSlash, withoutTrailingSlash } from "./correct-path.mjs";
|
|
9
|
-
import { commonPath } from "./common.mjs";
|
|
9
|
+
import { commonPath, findBasePath, findCommonPath } from "./common.mjs";
|
|
10
10
|
import { delimiter, posix, win32 } from "./delimiter.mjs";
|
|
11
11
|
import { basename, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, hasFileExtension, hasFileName, hasFilePath, hasFolderName, parsePath, relative, relativePath, relativeToCurrentDir, renameFile, resolve, resolvePath, resolvePaths } from "./file-path-fns.mjs";
|
|
12
12
|
import { globToRegex } from "./glob-to-regex.mjs";
|
|
@@ -14,4 +14,4 @@ import { isSystemRoot } from "./is-root-dir.mjs";
|
|
|
14
14
|
import { replaceExtension, replacePath } from "./replace.mjs";
|
|
15
15
|
import { resolveParentPath } from "./resolve-parent-path.mjs";
|
|
16
16
|
|
|
17
|
-
export { ABSOLUTE_PATH_REGEX, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
|
17
|
+
export { ABSOLUTE_PATH_REGEX, DEFAULT_ASSET_EXTS, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, FILE_EXTENSION_REGEX, FULL_FILE_EXTENSION_REGEX, NPM_SCOPED_PACKAGE_REGEX, PACKAGE_PATH_REGEX, ROOT_FOLDER_REGEX, UNC_REGEX, append, appendExtension, appendPath, basename, commonPath, correctPath, cwd, delimiter, dirname, extname, findBasePath, findCommonPath, findFileDotExtension, findFileDotExtensionSafe, findFileExtension, findFileExtensionSafe, findFileName, findFilePath, findFolderName, formatSlash, globToRegex, hasFileExtension, hasFileName, hasFilePath, hasFolderName, isParentPath, isSystemRoot, join, joinPaths, normalizeString, normalizeWindowsPath, parsePath, posix, relative, relativePath, relativeToCurrentDir, renameFile, replaceExtension, replacePath, resolve, resolveParentPath, resolvePath, resolvePaths, slash, stripStars, toAbsolutePath, toRelativePath, win32, withTrailingSlash, withoutTrailingSlash };
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/path",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.27.0",
|
|
4
|
+
"private": false,
|
|
5
5
|
"description": "A package containing various utilities that expand the functionality of NodeJs's built-in `path` module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "github",
|
|
8
8
|
"url": "https://github.com/storm-software/stryke.git",
|
|
9
9
|
"directory": "packages/path"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"main": "./dist/index.cjs",
|
|
13
|
-
"module": "./dist/index.mjs",
|
|
11
|
+
"type": "module",
|
|
14
12
|
"exports": {
|
|
15
13
|
".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
|
|
16
14
|
"./append": {
|
|
@@ -76,14 +74,16 @@
|
|
|
76
74
|
"./slash": { "require": "./dist/slash.cjs", "import": "./dist/slash.mjs" },
|
|
77
75
|
"./*": "./*"
|
|
78
76
|
},
|
|
77
|
+
"main": "./dist/index.cjs",
|
|
78
|
+
"module": "./dist/index.mjs",
|
|
79
79
|
"types": "./dist/index.d.cts",
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@storm-software/testing-tools": "^1.119.
|
|
82
|
-
"@stryke/convert": "^0.6.
|
|
83
|
-
"@stryke/type-checks": "^0.5.
|
|
84
|
-
"@stryke/types": "^0.10.
|
|
81
|
+
"@storm-software/testing-tools": "^1.119.103",
|
|
82
|
+
"@stryke/convert": "^0.6.54",
|
|
83
|
+
"@stryke/type-checks": "^0.5.39",
|
|
84
|
+
"@stryke/types": "^0.10.53",
|
|
85
85
|
"tsdown": "^0.17.2"
|
|
86
86
|
},
|
|
87
87
|
"publishConfig": { "access": "public" },
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "a1bde3f52c2327c62bee625670e6699a3c262345"
|
|
89
89
|
}
|