@powerlines/plugin-deepkit 0.11.286 → 0.11.287

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.
Files changed (27) hide show
  1. package/dist/index.cjs +2 -1
  2. package/dist/index.d.cts.map +1 -1
  3. package/dist/index.d.mts.map +1 -1
  4. package/dist/index.mjs +2 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/append.cjs +38 -0
  7. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/append.mjs +39 -0
  8. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/append.mjs.map +1 -0
  9. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/cwd.cjs +17 -0
  10. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/cwd.mjs +17 -0
  11. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/cwd.mjs.map +1 -0
  12. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.cjs +32 -0
  13. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.mjs +33 -0
  14. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.mjs.map +1 -0
  15. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-type.cjs +28 -0
  16. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-type.mjs +29 -0
  17. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/is-type.mjs.map +1 -0
  18. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/join-paths.cjs +122 -0
  19. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/join-paths.mjs +123 -0
  20. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/join-paths.mjs.map +1 -0
  21. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/regex.cjs +12 -0
  22. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/regex.mjs +9 -0
  23. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/regex.mjs.map +1 -0
  24. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/slash.cjs +15 -0
  25. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/slash.mjs +15 -0
  26. package/dist/node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/slash.mjs.map +1 -0
  27. package/package.json +7 -6
package/dist/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
2
  const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ const require_append = require('./node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/append.cjs');
3
4
  let _powerlines_deepkit_transformer = require("@powerlines/deepkit/transformer");
4
5
  let _powerlines_plugin_tsc = require("@powerlines/plugin-tsc");
5
6
  _powerlines_plugin_tsc = require_runtime.__toESM(_powerlines_plugin_tsc, 1);
@@ -38,7 +39,7 @@ const plugin = (options = {}) => {
38
39
  exclude: this.config.deepkit.exclude ?? [],
39
40
  reflection,
40
41
  level,
41
- configFilePath: this.tsconfig.tsconfigFilePath
42
+ configFilePath: require_append.appendPath(this.tsconfig.tsconfigFilePath, this.options.cwd)
42
43
  };
43
44
  this.config.tsc.transformers ??= {
44
45
  before: [],
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA6BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA8BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA6BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA8BY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;;;;cAUD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { appendPath } from "./node_modules/.pnpm/@stryke_path@0.27.4/node_modules/@stryke/path/dist/append.mjs";
1
2
  import { createDeclarationTransformer, createTransformer } from "@powerlines/deepkit/transformer";
2
3
  import tsc from "@powerlines/plugin-tsc";
3
4
 
@@ -35,7 +36,7 @@ const plugin = (options = {}) => {
35
36
  exclude: this.config.deepkit.exclude ?? [],
36
37
  reflection,
37
38
  level,
38
- configFilePath: this.tsconfig.tsconfigFilePath
39
+ configFilePath: appendPath(this.tsconfig.tsconfigFilePath, this.options.cwd)
39
40
  };
40
41
  this.config.tsc.transformers ??= {
41
42
  before: [],
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n createDeclarationTransformer,\n createTransformer\n} from \"@powerlines/deepkit/transformer\";\nimport tsc from \"@powerlines/plugin-tsc\";\nimport { Plugin } from \"powerlines\";\nimport { DeepkitPluginContext, DeepkitPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n deepkit?: DeepkitPluginOptions;\n }\n}\n\n/**\n * Deepkit plugin for Powerlines.\n *\n * @param options - The Deepkit plugin user configuration options.\n * @returns A Powerlines plugin that integrates Deepkit transformations.\n */\nexport const plugin = <\n TContext extends DeepkitPluginContext = DeepkitPluginContext\n>(\n options: DeepkitPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n tsc(options),\n {\n name: \"deepkit\",\n config() {\n return {\n deepkit: options ?? {},\n resolve: {\n external: [\n \"@powerlines/deepkit/vendor/type-compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/config\",\n \"@powerlines/deepkit/vendor/type-spec\",\n \"@powerlines/deepkit/vendor/type\",\n \"@powerlines/deepkit/vendor/core\"\n ]\n }\n };\n },\n configResolved: {\n order: \"post\",\n async handler() {\n const reflection =\n this.config.deepkit.reflection ||\n this.tsconfig.tsconfigJson.compilerOptions?.reflection ||\n this.tsconfig.tsconfigJson.reflection ||\n \"default\";\n const level =\n this.config.deepkit.level ||\n this.tsconfig.tsconfigJson.compilerOptions?.level ||\n this.tsconfig.tsconfigJson.level ||\n \"default\";\n\n this.config.tsc ??= {} as TContext[\"config\"][\"tsc\"];\n this.config.tsc.compilerOptions = {\n ...(this.config.tsc.compilerOptions ?? {}),\n exclude: this.config.deepkit.exclude ?? [],\n reflection,\n level,\n configFilePath: this.tsconfig.tsconfigFilePath\n };\n\n this.config.tsc.transformers ??= {\n before: [],\n after: []\n };\n\n this.config.tsc.transformers.before!.push(\n createTransformer(this, this.config.deepkit)\n );\n this.config.tsc.transformers.after!.push(\n createDeclarationTransformer(this, this.config.deepkit)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAwCA,MAAa,UAGX,UAAgC,EAAE,KACX;AACvB,QAAO,CACL,IAAI,QAAQ,EACZ;EACE,MAAM;EACN,SAAS;AACP,UAAO;IACL,SAAS,WAAW,EAAE;IACtB,SAAS,EACP,UAAU;KACR;KACA;KACA;KACA;KACA;KACA;KACD,EACF;IACF;;EAEH,gBAAgB;GACd,OAAO;GACP,MAAM,UAAU;IACd,MAAM,aACJ,KAAK,OAAO,QAAQ,cACpB,KAAK,SAAS,aAAa,iBAAiB,cAC5C,KAAK,SAAS,aAAa,cAC3B;IACF,MAAM,QACJ,KAAK,OAAO,QAAQ,SACpB,KAAK,SAAS,aAAa,iBAAiB,SAC5C,KAAK,SAAS,aAAa,SAC3B;AAEF,SAAK,OAAO,QAAQ,EAAE;AACtB,SAAK,OAAO,IAAI,kBAAkB;KAChC,GAAI,KAAK,OAAO,IAAI,mBAAmB,EAAE;KACzC,SAAS,KAAK,OAAO,QAAQ,WAAW,EAAE;KAC1C;KACA;KACA,gBAAgB,KAAK,SAAS;KAC/B;AAED,SAAK,OAAO,IAAI,iBAAiB;KAC/B,QAAQ,EAAE;KACV,OAAO,EAAE;KACV;AAED,SAAK,OAAO,IAAI,aAAa,OAAQ,KACnC,kBAAkB,MAAM,KAAK,OAAO,QAAQ,CAC7C;AACD,SAAK,OAAO,IAAI,aAAa,MAAO,KAClC,6BAA6B,MAAM,KAAK,OAAO,QAAQ,CACxD;;GAEJ;EACF,CACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\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/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n createDeclarationTransformer,\n createTransformer\n} from \"@powerlines/deepkit/transformer\";\nimport tsc from \"@powerlines/plugin-tsc\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { Plugin } from \"powerlines\";\nimport { DeepkitPluginContext, DeepkitPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n deepkit?: DeepkitPluginOptions;\n }\n}\n\n/**\n * Deepkit plugin for Powerlines.\n *\n * @param options - The Deepkit plugin user configuration options.\n * @returns A Powerlines plugin that integrates Deepkit transformations.\n */\nexport const plugin = <\n TContext extends DeepkitPluginContext = DeepkitPluginContext\n>(\n options: DeepkitPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n tsc(options),\n {\n name: \"deepkit\",\n config() {\n return {\n deepkit: options ?? {},\n resolve: {\n external: [\n \"@powerlines/deepkit/vendor/type-compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/compiler\",\n \"@powerlines/deepkit/vendor/type-compiler/config\",\n \"@powerlines/deepkit/vendor/type-spec\",\n \"@powerlines/deepkit/vendor/type\",\n \"@powerlines/deepkit/vendor/core\"\n ]\n }\n };\n },\n configResolved: {\n order: \"post\",\n async handler() {\n const reflection =\n this.config.deepkit.reflection ||\n this.tsconfig.tsconfigJson.compilerOptions?.reflection ||\n this.tsconfig.tsconfigJson.reflection ||\n \"default\";\n const level =\n this.config.deepkit.level ||\n this.tsconfig.tsconfigJson.compilerOptions?.level ||\n this.tsconfig.tsconfigJson.level ||\n \"default\";\n\n this.config.tsc ??= {} as TContext[\"config\"][\"tsc\"];\n this.config.tsc.compilerOptions = {\n ...(this.config.tsc.compilerOptions ?? {}),\n exclude: this.config.deepkit.exclude ?? [],\n reflection,\n level,\n configFilePath: appendPath(\n this.tsconfig.tsconfigFilePath,\n this.options.cwd\n )\n };\n\n this.config.tsc.transformers ??= {\n before: [],\n after: []\n };\n\n this.config.tsc.transformers.before!.push(\n createTransformer(this, this.config.deepkit)\n );\n this.config.tsc.transformers.after!.push(\n createDeclarationTransformer(this, this.config.deepkit)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAyCA,MAAa,UAGX,UAAgC,EAAE,KACX;AACvB,QAAO,CACL,IAAI,QAAQ,EACZ;EACE,MAAM;EACN,SAAS;AACP,UAAO;IACL,SAAS,WAAW,EAAE;IACtB,SAAS,EACP,UAAU;KACR;KACA;KACA;KACA;KACA;KACA;KACD,EACF;IACF;;EAEH,gBAAgB;GACd,OAAO;GACP,MAAM,UAAU;IACd,MAAM,aACJ,KAAK,OAAO,QAAQ,cACpB,KAAK,SAAS,aAAa,iBAAiB,cAC5C,KAAK,SAAS,aAAa,cAC3B;IACF,MAAM,QACJ,KAAK,OAAO,QAAQ,SACpB,KAAK,SAAS,aAAa,iBAAiB,SAC5C,KAAK,SAAS,aAAa,SAC3B;AAEF,SAAK,OAAO,QAAQ,EAAE;AACtB,SAAK,OAAO,IAAI,kBAAkB;KAChC,GAAI,KAAK,OAAO,IAAI,mBAAmB,EAAE;KACzC,SAAS,KAAK,OAAO,QAAQ,WAAW,EAAE;KAC1C;KACA;KACA,gBAAgB,WACd,KAAK,SAAS,kBACd,KAAK,QAAQ,IACd;KACF;AAED,SAAK,OAAO,IAAI,iBAAiB;KAC/B,QAAQ,EAAE;KACV,OAAO,EAAE;KACV;AAED,SAAK,OAAO,IAAI,aAAa,OAAQ,KACnC,kBAAkB,MAAM,KAAK,OAAO,QAAQ,CAC7C;AACD,SAAK,OAAO,IAAI,aAAa,MAAO,KAClC,6BAA6B,MAAM,KAAK,OAAO,QAAQ,CACxD;;GAEJ;EACF,CACF"}
@@ -0,0 +1,38 @@
1
+ const require_cwd = require('./cwd.cjs');
2
+ const require_slash = require('./slash.cjs');
3
+ const require_is_parent_path = require('./is-parent-path.cjs');
4
+ const require_join_paths = require('./join-paths.cjs');
5
+
6
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/append.mjs
7
+ /**
8
+ * If not already a parent path, append the base path from the beginning of the given child path.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * appendPath("src/index.ts", "/home/user/project");
13
+ * // returns "/home/user/project/src/index.ts"
14
+ *
15
+ * appendPath("/user/dev/app.ts", "/user/dev");
16
+ * // returns "/user/dev/app.ts"
17
+ *
18
+ * appendPath("docs/readme.md");
19
+ * // returns "<current_working_directory>/docs/readme.md"
20
+ *
21
+ * appendPath("src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
22
+ * // returns "/home/user/project/src/index.ts"
23
+ *
24
+ * appendPath("/home/user/project/src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
25
+ * // returns "/home/user/project/src/index.ts"
26
+ * ```
27
+ *
28
+ * @param childPath - The child path to append to the {@link parentPath}
29
+ * @param parentPath - The parent path to add the {@link childPath} to
30
+ * @param options - Options for appending the path
31
+ * @returns The {@link parentPath} with the {@link childPath} appended
32
+ */
33
+ function appendPath(childPath, parentPath = require_cwd.cwd(), options = {}) {
34
+ return require_slash.slash(options.skipIfAlreadyParent !== false && require_is_parent_path.isParentPath(childPath, parentPath) ? childPath : require_join_paths.joinPaths(parentPath, childPath));
35
+ }
36
+
37
+ //#endregion
38
+ exports.appendPath = appendPath;
@@ -0,0 +1,39 @@
1
+ import { cwd } from "./cwd.mjs";
2
+ import { slash } from "./slash.mjs";
3
+ import { isParentPath } from "./is-parent-path.mjs";
4
+ import { joinPaths } from "./join-paths.mjs";
5
+
6
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/append.mjs
7
+ /**
8
+ * If not already a parent path, append the base path from the beginning of the given child path.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * appendPath("src/index.ts", "/home/user/project");
13
+ * // returns "/home/user/project/src/index.ts"
14
+ *
15
+ * appendPath("/user/dev/app.ts", "/user/dev");
16
+ * // returns "/user/dev/app.ts"
17
+ *
18
+ * appendPath("docs/readme.md");
19
+ * // returns "<current_working_directory>/docs/readme.md"
20
+ *
21
+ * appendPath("src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
22
+ * // returns "/home/user/project/src/index.ts"
23
+ *
24
+ * appendPath("/home/user/project/src/index.ts", "/home/user/project", { skipIfAlreadyParent: false });
25
+ * // returns "/home/user/project/src/index.ts"
26
+ * ```
27
+ *
28
+ * @param childPath - The child path to append to the {@link parentPath}
29
+ * @param parentPath - The parent path to add the {@link childPath} to
30
+ * @param options - Options for appending the path
31
+ * @returns The {@link parentPath} with the {@link childPath} appended
32
+ */
33
+ function appendPath(childPath, parentPath = cwd(), options = {}) {
34
+ return slash(options.skipIfAlreadyParent !== false && isParentPath(childPath, parentPath) ? childPath : joinPaths(parentPath, childPath));
35
+ }
36
+
37
+ //#endregion
38
+ export { appendPath };
39
+ //# sourceMappingURL=append.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/append.mjs"],"sourcesContent":["import { cwd } from \"./cwd.mjs\";\nimport { slash } from \"./slash.mjs\";\nimport { isParentPath } from \"./is-parent-path.mjs\";\nimport { joinPaths } from \"./join-paths.mjs\";\n\n//#region src/append.ts\n/**\n* If not already a parent path, append the base path from the beginning of the given child path.\n*\n* @example\n* ```ts\n* appendPath(\"src/index.ts\", \"/home/user/project\");\n* // returns \"/home/user/project/src/index.ts\"\n*\n* appendPath(\"/user/dev/app.ts\", \"/user/dev\");\n* // returns \"/user/dev/app.ts\"\n*\n* appendPath(\"docs/readme.md\");\n* // returns \"<current_working_directory>/docs/readme.md\"\n*\n* appendPath(\"src/index.ts\", \"/home/user/project\", { skipIfAlreadyParent: false });\n* // returns \"/home/user/project/src/index.ts\"\n*\n* appendPath(\"/home/user/project/src/index.ts\", \"/home/user/project\", { skipIfAlreadyParent: false });\n* // returns \"/home/user/project/src/index.ts\"\n* ```\n*\n* @param childPath - The child path to append to the {@link parentPath}\n* @param parentPath - The parent path to add the {@link childPath} to\n* @param options - Options for appending the path\n* @returns The {@link parentPath} with the {@link childPath} appended\n*/\nfunction appendPath(childPath, parentPath = cwd(), options = {}) {\n\treturn slash(options.skipIfAlreadyParent !== false && isParentPath(childPath, parentPath) ? childPath : joinPaths(parentPath, childPath));\n}\nconst append = appendPath;\n/**\n* Append the extension to the given path.\n*\n* @example\n* ```ts\n* appendExtension(\"/home/user/project/src/index\", \".ts\");\n* // returns \"/home/user/project/src/index.ts\"\n* appendExtension(\"/home/user/project/src/index.ts\", \".js\");\n* // returns \"/home/user/project/src/index.ts.js\"\n* ```\n*\n* @param path - The path to append the extension to.\n* @param extension - The extension to append.\n* @returns The path with the appended extension.\n*/\nfunction appendExtension(path, extension) {\n\treturn `${path}.${extension.replace(/^\\./, \"\")}`;\n}\n\n//#endregion\nexport { append, appendExtension, appendPath };\n//# sourceMappingURL=append.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,WAAW,WAAW,aAAa,KAAK,EAAE,UAAU,EAAE,EAAE;AAChE,QAAO,MAAM,QAAQ,wBAAwB,SAAS,aAAa,WAAW,WAAW,GAAG,YAAY,UAAU,YAAY,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/cwd.mjs
3
+ /**
4
+ * Get the current working directory.
5
+ *
6
+ * @remarks
7
+ * This function attempts to retrieve the current working directory using `process.cwd()`.
8
+ *
9
+ * @returns The current working directory or '/' if it cannot be determined
10
+ */
11
+ function cwd() {
12
+ if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
13
+ return "/";
14
+ }
15
+
16
+ //#endregion
17
+ exports.cwd = cwd;
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/cwd.mjs
2
+ /**
3
+ * Get the current working directory.
4
+ *
5
+ * @remarks
6
+ * This function attempts to retrieve the current working directory using `process.cwd()`.
7
+ *
8
+ * @returns The current working directory or '/' if it cannot be determined
9
+ */
10
+ function cwd() {
11
+ if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
12
+ return "/";
13
+ }
14
+
15
+ //#endregion
16
+ export { cwd };
17
+ //# sourceMappingURL=cwd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cwd.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/cwd.mjs"],"sourcesContent":["//#region src/cwd.ts\n/**\n* Get the current working directory.\n*\n* @remarks\n* This function attempts to retrieve the current working directory using `process.cwd()`.\n*\n* @returns The current working directory or '/' if it cannot be determined\n*/\nfunction cwd() {\n\tif (typeof process !== \"undefined\" && typeof process.cwd === \"function\") return process.cwd().replace(/\\\\/g, \"/\");\n\treturn \"/\";\n}\n\n//#endregion\nexport { cwd };\n//# sourceMappingURL=cwd.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,MAAM;AACd,KAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,QAAQ,WAAY,QAAO,QAAQ,KAAK,CAAC,QAAQ,OAAO,IAAI;AACjH,QAAO"}
@@ -0,0 +1,32 @@
1
+ const require_slash = require('./slash.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.mjs
4
+ /**
5
+ * Check if a given path is a parent of another path.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src");
10
+ * // returns true
11
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project");
12
+ * // returns true
13
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/other");
14
+ * // returns false
15
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/other");
16
+ * // returns false
17
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/index.ts");
18
+ * // returns false
19
+ * ```
20
+ *
21
+ * @param childPath - The path to check if it is a child of the parent path.
22
+ * @param parentPath - The path to check if it is a parent of the child path.
23
+ * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.
24
+ */
25
+ function isParentPath(childPath, parentPath) {
26
+ const normalizedChild = require_slash.slash(childPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
27
+ const normalizedParent = require_slash.slash(parentPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
28
+ return childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
29
+ }
30
+
31
+ //#endregion
32
+ exports.isParentPath = isParentPath;
@@ -0,0 +1,33 @@
1
+ import { slash } from "./slash.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.mjs
4
+ /**
5
+ * Check if a given path is a parent of another path.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src");
10
+ * // returns true
11
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project");
12
+ * // returns true
13
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/other");
14
+ * // returns false
15
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/other");
16
+ * // returns false
17
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/index.ts");
18
+ * // returns false
19
+ * ```
20
+ *
21
+ * @param childPath - The path to check if it is a child of the parent path.
22
+ * @param parentPath - The path to check if it is a parent of the child path.
23
+ * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.
24
+ */
25
+ function isParentPath(childPath, parentPath) {
26
+ const normalizedChild = slash(childPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
27
+ const normalizedParent = slash(parentPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
28
+ return childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
29
+ }
30
+
31
+ //#endregion
32
+ export { isParentPath };
33
+ //# sourceMappingURL=is-parent-path.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-parent-path.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-parent-path.mjs"],"sourcesContent":["import { slash } from \"./slash.mjs\";\n\n//#region src/is-parent-path.ts\n/**\n* Check if a given path is a parent of another path.\n*\n* @example\n* ```ts\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src\");\n* // returns true\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project\");\n* // returns true\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/other\");\n* // returns false\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/other\");\n* // returns false\n* isParentPath(\"/home/user/project/src/index.ts\", \"/home/user/project/src/index.ts\");\n* // returns false\n* ```\n*\n* @param childPath - The path to check if it is a child of the parent path.\n* @param parentPath - The path to check if it is a parent of the child path.\n* @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.\n*/\nfunction isParentPath(childPath, parentPath) {\n\tconst normalizedChild = slash(childPath.replaceAll(/\\\\/g, \"/\").replace(/\\/*$/, \"\"))?.toLowerCase();\n\tconst normalizedParent = slash(parentPath.replaceAll(/\\\\/g, \"/\").replace(/\\/*$/, \"\"))?.toLowerCase();\n\treturn childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);\n}\n\n//#endregion\nexport { isParentPath };\n//# sourceMappingURL=is-parent-path.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,aAAa,WAAW,YAAY;CAC5C,MAAM,kBAAkB,MAAM,UAAU,WAAW,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAC,EAAE,aAAa;CAClG,MAAM,mBAAmB,MAAM,WAAW,WAAW,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG,CAAC,EAAE,aAAa;AACpG,QAAO,cAAc,cAAc,oBAAoB,oBAAoB,gBAAgB,WAAW,GAAG,iBAAiB,GAAG"}
@@ -0,0 +1,28 @@
1
+ const require_regex = require('./regex.cjs');
2
+ const require_slash = require('./slash.cjs');
3
+
4
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-type.mjs
5
+ /**
6
+ * Check if the path is an absolute path.
7
+ *
8
+ * @param path - The path to check
9
+ * @returns An indicator specifying if the path is an absolute path
10
+ */
11
+ function isAbsolutePath(path) {
12
+ return require_regex.ABSOLUTE_PATH_REGEX.test(require_slash.slash(path));
13
+ }
14
+ /**
15
+ * Check if the path is an absolute path.
16
+ *
17
+ * @remarks
18
+ * This is an alias for {@link isAbsolutePath}.
19
+ *
20
+ * @param path - The path to check
21
+ * @returns An indicator specifying if the path is an absolute path
22
+ */
23
+ function isAbsolute(path) {
24
+ return isAbsolutePath(path);
25
+ }
26
+
27
+ //#endregion
28
+ exports.isAbsolute = isAbsolute;
@@ -0,0 +1,29 @@
1
+ import { ABSOLUTE_PATH_REGEX } from "./regex.mjs";
2
+ import { slash } from "./slash.mjs";
3
+
4
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-type.mjs
5
+ /**
6
+ * Check if the path is an absolute path.
7
+ *
8
+ * @param path - The path to check
9
+ * @returns An indicator specifying if the path is an absolute path
10
+ */
11
+ function isAbsolutePath(path) {
12
+ return ABSOLUTE_PATH_REGEX.test(slash(path));
13
+ }
14
+ /**
15
+ * Check if the path is an absolute path.
16
+ *
17
+ * @remarks
18
+ * This is an alias for {@link isAbsolutePath}.
19
+ *
20
+ * @param path - The path to check
21
+ * @returns An indicator specifying if the path is an absolute path
22
+ */
23
+ function isAbsolute(path) {
24
+ return isAbsolutePath(path);
25
+ }
26
+
27
+ //#endregion
28
+ export { isAbsolute };
29
+ //# sourceMappingURL=is-type.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-type.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/is-type.mjs"],"sourcesContent":["import { ABSOLUTE_PATH_REGEX, NPM_SCOPED_PACKAGE_REGEX } from \"./regex.mjs\";\nimport { slash } from \"./slash.mjs\";\n\n//#region src/is-type.ts\n/**\n* Check if the path is an absolute path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolutePath(path) {\n\treturn ABSOLUTE_PATH_REGEX.test(slash(path));\n}\n/**\n* Check if the path is an absolute path.\n*\n* @remarks\n* This is an alias for {@link isAbsolutePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is an absolute path\n*/\nfunction isAbsolute(path) {\n\treturn isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelativePath(path) {\n\treturn !isAbsolutePath(path);\n}\n/**\n* Check if the path is a relative path.\n*\n* @remarks\n* This is an alias for {@link isRelativePath}.\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a relative path\n*/\nfunction isRelative(path) {\n\treturn isRelativePath(path);\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackage}.\n*\n* @example\n* ```ts\n* isNpmScopedPackage(\"@stryke/path\"); // returns true\n* isNpmScopedPackage(\"lodash\"); // returns false\n* isNpmNamespacePackage(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackagePath(path) {\n\treturn NPM_SCOPED_PACKAGE_REGEX.test(slash(path));\n}\n/**\n* Check if the path is a npm package path.\n*\n* @remarks\n* This only checks if the path matches the npm namespace scoped package naming convention such as `@scope/package-name`. This is an alias for {@link isNpmScopedPackagePath}.\n*\n* @example\n* ```ts\n* isNpmScopedPackagePath(\"@stryke/path\"); // returns true\n* isNpmScopedPackagePath(\"lodash\"); // returns false\n* isNpmScopedPackagePath(\"./src/index.ts\"); // returns false\n* ```\n*\n* @param path - The path to check\n* @returns An indicator specifying if the path is a npm package path\n*/\nfunction isNpmScopedPackage(path) {\n\treturn isNpmScopedPackagePath(path);\n}\n\n//#endregion\nexport { isAbsolute, isAbsolutePath, isNpmScopedPackage, isNpmScopedPackagePath, isRelative, isRelativePath };\n//# sourceMappingURL=is-type.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAS,eAAe,MAAM;AAC7B,QAAO,oBAAoB,KAAK,MAAM,KAAK,CAAC;;;;;;;;;;;AAW7C,SAAS,WAAW,MAAM;AACzB,QAAO,eAAe,KAAK"}
@@ -0,0 +1,122 @@
1
+ const require_regex = require('./regex.cjs');
2
+ const require_is_type = require('./is-type.cjs');
3
+ const require_slash = require('./slash.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/join-paths.mjs
6
+ function normalizeWindowsPath(input = "") {
7
+ if (!input) return input;
8
+ return input.replace(/\\/g, "/").replace(require_regex.DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
9
+ }
10
+ function correctPaths(path) {
11
+ if (!path || path.length === 0) return ".";
12
+ path = normalizeWindowsPath(path);
13
+ const isUNCPath = path.match(require_regex.UNC_REGEX);
14
+ const isPathAbsolute = require_is_type.isAbsolute(path);
15
+ const trailingSeparator = path[path.length - 1] === "/";
16
+ path = normalizeString(path, !isPathAbsolute);
17
+ if (path.length === 0) {
18
+ if (isPathAbsolute) return "/";
19
+ return trailingSeparator ? "./" : ".";
20
+ }
21
+ if (trailingSeparator) path += "/";
22
+ if (require_regex.DRIVE_LETTER_REGEX.test(path)) path += "/";
23
+ if (isUNCPath) {
24
+ if (!isPathAbsolute) return `//./${path}`;
25
+ return `//${path}`;
26
+ }
27
+ return isPathAbsolute && !require_is_type.isAbsolute(path) ? `/${path}` : path;
28
+ }
29
+ /**
30
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
31
+ *
32
+ * @remarks
33
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { joinPaths } from 'stryke/path';
38
+ *
39
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
40
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
41
+ *
42
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
43
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
44
+ *
45
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
46
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
47
+ *
48
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
49
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
50
+ * ```
51
+ *
52
+ * @param segments - The path segments to join.
53
+ * @returns The joined and normalized path string.
54
+ */
55
+ function joinPaths(...segments) {
56
+ let result = "";
57
+ for (const segment of segments) if (segment && require_slash.slash(segment).replaceAll(/\//g, "") !== ".") {
58
+ if (result) if (require_slash.slash(segment).replaceAll(/\//g, "") === "..") result = require_slash.slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
59
+ else result = `${require_slash.slash(result).replace(/\/+$/, "")}/${require_slash.slash(segment).replace(/^\/+/, "")}`;
60
+ else if (require_slash.slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
61
+ }
62
+ return correctPaths(result);
63
+ }
64
+ /**
65
+ * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
66
+ *
67
+ * @param path - The path to normalize.
68
+ * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
69
+ * @returns the normalized path string.
70
+ */
71
+ function normalizeString(path, allowAboveRoot) {
72
+ let res = "";
73
+ let lastSegmentLength = 0;
74
+ let lastSlash = -1;
75
+ let dots = 0;
76
+ let char = null;
77
+ for (let index = 0; index <= path.length; ++index) {
78
+ if (index < path.length) char = path[index];
79
+ else if (char === "/") break;
80
+ else char = "/";
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
83
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
84
+ if (res.length > 2) {
85
+ const lastSlashIndex = res.lastIndexOf("/");
86
+ if (lastSlashIndex === -1) {
87
+ res = "";
88
+ lastSegmentLength = 0;
89
+ } else {
90
+ res = res.slice(0, lastSlashIndex);
91
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
92
+ }
93
+ lastSlash = index;
94
+ dots = 0;
95
+ continue;
96
+ } else if (res.length > 0) {
97
+ res = "";
98
+ lastSegmentLength = 0;
99
+ lastSlash = index;
100
+ dots = 0;
101
+ continue;
102
+ }
103
+ }
104
+ if (allowAboveRoot) {
105
+ res += res.length > 0 ? "/.." : "..";
106
+ lastSegmentLength = 2;
107
+ }
108
+ } else {
109
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
110
+ else res = path.slice(lastSlash + 1, index);
111
+ lastSegmentLength = index - lastSlash - 1;
112
+ }
113
+ lastSlash = index;
114
+ dots = 0;
115
+ } else if (char === "." && dots !== -1) ++dots;
116
+ else dots = -1;
117
+ }
118
+ return res;
119
+ }
120
+
121
+ //#endregion
122
+ exports.joinPaths = joinPaths;
@@ -0,0 +1,123 @@
1
+ import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from "./regex.mjs";
2
+ import { isAbsolute } from "./is-type.mjs";
3
+ import { slash } from "./slash.mjs";
4
+
5
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/join-paths.mjs
6
+ function normalizeWindowsPath(input = "") {
7
+ if (!input) return input;
8
+ return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
9
+ }
10
+ function correctPaths(path) {
11
+ if (!path || path.length === 0) return ".";
12
+ path = normalizeWindowsPath(path);
13
+ const isUNCPath = path.match(UNC_REGEX);
14
+ const isPathAbsolute = isAbsolute(path);
15
+ const trailingSeparator = path[path.length - 1] === "/";
16
+ path = normalizeString(path, !isPathAbsolute);
17
+ if (path.length === 0) {
18
+ if (isPathAbsolute) return "/";
19
+ return trailingSeparator ? "./" : ".";
20
+ }
21
+ if (trailingSeparator) path += "/";
22
+ if (DRIVE_LETTER_REGEX.test(path)) path += "/";
23
+ if (isUNCPath) {
24
+ if (!isPathAbsolute) return `//./${path}`;
25
+ return `//${path}`;
26
+ }
27
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
28
+ }
29
+ /**
30
+ * Joins all given path segments together using the platform-specific separator as a delimiter.
31
+ *
32
+ * @remarks
33
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { joinPaths } from 'stryke/path';
38
+ *
39
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
40
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
41
+ *
42
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
43
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
44
+ *
45
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
46
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
47
+ *
48
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
49
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
50
+ * ```
51
+ *
52
+ * @param segments - The path segments to join.
53
+ * @returns The joined and normalized path string.
54
+ */
55
+ function joinPaths(...segments) {
56
+ let result = "";
57
+ for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
58
+ if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
59
+ else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
60
+ else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
61
+ }
62
+ return correctPaths(result);
63
+ }
64
+ /**
65
+ * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
66
+ *
67
+ * @param path - The path to normalize.
68
+ * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
69
+ * @returns the normalized path string.
70
+ */
71
+ function normalizeString(path, allowAboveRoot) {
72
+ let res = "";
73
+ let lastSegmentLength = 0;
74
+ let lastSlash = -1;
75
+ let dots = 0;
76
+ let char = null;
77
+ for (let index = 0; index <= path.length; ++index) {
78
+ if (index < path.length) char = path[index];
79
+ else if (char === "/") break;
80
+ else char = "/";
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
83
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
84
+ if (res.length > 2) {
85
+ const lastSlashIndex = res.lastIndexOf("/");
86
+ if (lastSlashIndex === -1) {
87
+ res = "";
88
+ lastSegmentLength = 0;
89
+ } else {
90
+ res = res.slice(0, lastSlashIndex);
91
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
92
+ }
93
+ lastSlash = index;
94
+ dots = 0;
95
+ continue;
96
+ } else if (res.length > 0) {
97
+ res = "";
98
+ lastSegmentLength = 0;
99
+ lastSlash = index;
100
+ dots = 0;
101
+ continue;
102
+ }
103
+ }
104
+ if (allowAboveRoot) {
105
+ res += res.length > 0 ? "/.." : "..";
106
+ lastSegmentLength = 2;
107
+ }
108
+ } else {
109
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
110
+ else res = path.slice(lastSlash + 1, index);
111
+ lastSegmentLength = index - lastSlash - 1;
112
+ }
113
+ lastSlash = index;
114
+ dots = 0;
115
+ } else if (char === "." && dots !== -1) ++dots;
116
+ else dots = -1;
117
+ }
118
+ return res;
119
+ }
120
+
121
+ //#endregion
122
+ export { joinPaths };
123
+ //# sourceMappingURL=join-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-paths.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/join-paths.mjs"],"sourcesContent":["import { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from \"./regex.mjs\";\nimport { isAbsolute } from \"./is-type.mjs\";\nimport { slash } from \"./slash.mjs\";\n\n//#region src/join-paths.ts\nfunction normalizeWindowsPath(input = \"\") {\n\tif (!input) return input;\n\treturn input.replace(/\\\\/g, \"/\").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());\n}\nfunction correctPaths(path) {\n\tif (!path || path.length === 0) return \".\";\n\tpath = normalizeWindowsPath(path);\n\tconst isUNCPath = path.match(UNC_REGEX);\n\tconst isPathAbsolute = isAbsolute(path);\n\tconst trailingSeparator = path[path.length - 1] === \"/\";\n\tpath = normalizeString(path, !isPathAbsolute);\n\tif (path.length === 0) {\n\t\tif (isPathAbsolute) return \"/\";\n\t\treturn trailingSeparator ? \"./\" : \".\";\n\t}\n\tif (trailingSeparator) path += \"/\";\n\tif (DRIVE_LETTER_REGEX.test(path)) path += \"/\";\n\tif (isUNCPath) {\n\t\tif (!isPathAbsolute) return `//./${path}`;\n\t\treturn `//${path}`;\n\t}\n\treturn isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n/**\n* Joins all given path segments together using the platform-specific separator as a delimiter.\n*\n* @remarks\n* Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.\n*\n* @example\n* ```ts\n* import { joinPaths } from 'stryke/path';\n*\n* const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');\n* console.log(fullPath); // Output: 'folder1/folder3/file.txt'\n*\n* const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');\n* console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'\n*\n* const windowsPath = joinPaths('C:\\\\', 'Users', 'Public', '..', 'Documents', 'file.txt');\n* console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'\n*\n* const uncPath = joinPaths('\\\\\\\\Server\\\\Share', 'Folder', 'File.txt');\n* console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'\n* ```\n*\n* @param segments - The path segments to join.\n* @returns The joined and normalized path string.\n*/\nfunction joinPaths(...segments) {\n\tlet result = \"\";\n\tfor (const segment of segments) if (segment && slash(segment).replaceAll(/\\//g, \"\") !== \".\") {\n\t\tif (result) if (slash(segment).replaceAll(/\\//g, \"\") === \"..\") result = slash(result).replace(/\\/+$/, \"\").replace(/\\/*[^/]+$/, \"\");\n\t\telse result = `${slash(result).replace(/\\/+$/, \"\")}/${slash(segment).replace(/^\\/+/, \"\")}`;\n\t\telse if (slash(segment).replaceAll(/\\//g, \"\") !== \"..\") result = segment;\n\t}\n\treturn correctPaths(result);\n}\nconst join = joinPaths;\n/**\n* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n*\n* @param path - The path to normalize.\n* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n* @returns the normalized path string.\n*/\nfunction normalizeString(path, allowAboveRoot) {\n\tlet res = \"\";\n\tlet lastSegmentLength = 0;\n\tlet lastSlash = -1;\n\tlet dots = 0;\n\tlet char = null;\n\tfor (let index = 0; index <= path.length; ++index) {\n\t\tif (index < path.length) char = path[index];\n\t\telse if (char === \"/\") break;\n\t\telse char = \"/\";\n\t\tif (char === \"/\") {\n\t\t\tif (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {\n\t\t\t\tif (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== \".\" || res[res.length - 2] !== \".\") {\n\t\t\t\t\tif (res.length > 2) {\n\t\t\t\t\t\tconst lastSlashIndex = res.lastIndexOf(\"/\");\n\t\t\t\t\t\tif (lastSlashIndex === -1) {\n\t\t\t\t\t\t\tres = \"\";\n\t\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tres = res.slice(0, lastSlashIndex);\n\t\t\t\t\t\t\tlastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastSlash = index;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (res.length > 0) {\n\t\t\t\t\t\tres = \"\";\n\t\t\t\t\t\tlastSegmentLength = 0;\n\t\t\t\t\t\tlastSlash = index;\n\t\t\t\t\t\tdots = 0;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (allowAboveRoot) {\n\t\t\t\t\tres += res.length > 0 ? \"/..\" : \"..\";\n\t\t\t\t\tlastSegmentLength = 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;\n\t\t\t\telse res = path.slice(lastSlash + 1, index);\n\t\t\t\tlastSegmentLength = index - lastSlash - 1;\n\t\t\t}\n\t\t\tlastSlash = index;\n\t\t\tdots = 0;\n\t\t} else if (char === \".\" && dots !== -1) ++dots;\n\t\telse dots = -1;\n\t}\n\treturn res;\n}\n\n//#endregion\nexport { join, joinPaths };\n//# sourceMappingURL=join-paths.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAKA,SAAS,qBAAqB,QAAQ,IAAI;AACzC,KAAI,CAAC,MAAO,QAAO;AACnB,QAAO,MAAM,QAAQ,OAAO,IAAI,CAAC,QAAQ,2BAA2B,MAAM,EAAE,aAAa,CAAC;;AAE3F,SAAS,aAAa,MAAM;AAC3B,KAAI,CAAC,QAAQ,KAAK,WAAW,EAAG,QAAO;AACvC,QAAO,qBAAqB,KAAK;CACjC,MAAM,YAAY,KAAK,MAAM,UAAU;CACvC,MAAM,iBAAiB,WAAW,KAAK;CACvC,MAAM,oBAAoB,KAAK,KAAK,SAAS,OAAO;AACpD,QAAO,gBAAgB,MAAM,CAAC,eAAe;AAC7C,KAAI,KAAK,WAAW,GAAG;AACtB,MAAI,eAAgB,QAAO;AAC3B,SAAO,oBAAoB,OAAO;;AAEnC,KAAI,kBAAmB,SAAQ;AAC/B,KAAI,mBAAmB,KAAK,KAAK,CAAE,SAAQ;AAC3C,KAAI,WAAW;AACd,MAAI,CAAC,eAAgB,QAAO,OAAO;AACnC,SAAO,KAAK;;AAEb,QAAO,kBAAkB,CAAC,WAAW,KAAK,GAAG,IAAI,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B3D,SAAS,UAAU,GAAG,UAAU;CAC/B,IAAI,SAAS;AACb,MAAK,MAAM,WAAW,SAAU,KAAI,WAAW,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KACvF;MAAI,OAAQ,KAAI,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KAAM,UAAS,MAAM,OAAO,CAAC,QAAQ,QAAQ,GAAG,CAAC,QAAQ,aAAa,GAAG;MAC7H,UAAS,GAAG,MAAM,OAAO,CAAC,QAAQ,QAAQ,GAAG,CAAC,GAAG,MAAM,QAAQ,CAAC,QAAQ,QAAQ,GAAG;WAC/E,MAAM,QAAQ,CAAC,WAAW,OAAO,GAAG,KAAK,KAAM,UAAS;;AAElE,QAAO,aAAa,OAAO;;;;;;;;;AAU5B,SAAS,gBAAgB,MAAM,gBAAgB;CAC9C,IAAI,MAAM;CACV,IAAI,oBAAoB;CACxB,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAI,OAAO;AACX,MAAK,IAAI,QAAQ,GAAG,SAAS,KAAK,QAAQ,EAAE,OAAO;AAClD,MAAI,QAAQ,KAAK,OAAQ,QAAO,KAAK;WAC5B,SAAS,IAAK;MAClB,QAAO;AACZ,MAAI,SAAS,KAAK;AACjB,OAAI,cAAc,QAAQ,KAAK,SAAS,GAAG,YAAY,SAAS,GAAG;AAClE,QAAI,IAAI,SAAS,KAAK,sBAAsB,KAAK,IAAI,IAAI,SAAS,OAAO,OAAO,IAAI,IAAI,SAAS,OAAO,KACvG;SAAI,IAAI,SAAS,GAAG;MACnB,MAAM,iBAAiB,IAAI,YAAY,IAAI;AAC3C,UAAI,mBAAmB,IAAI;AAC1B,aAAM;AACN,2BAAoB;aACd;AACN,aAAM,IAAI,MAAM,GAAG,eAAe;AAClC,2BAAoB,IAAI,SAAS,IAAI,IAAI,YAAY,IAAI;;AAE1D,kBAAY;AACZ,aAAO;AACP;gBACU,IAAI,SAAS,GAAG;AAC1B,YAAM;AACN,0BAAoB;AACpB,kBAAY;AACZ,aAAO;AACP;;;AAGF,QAAI,gBAAgB;AACnB,YAAO,IAAI,SAAS,IAAI,QAAQ;AAChC,yBAAoB;;UAEf;AACN,QAAI,IAAI,SAAS,EAAG,QAAO,IAAI,KAAK,MAAM,YAAY,GAAG,MAAM;QAC1D,OAAM,KAAK,MAAM,YAAY,GAAG,MAAM;AAC3C,wBAAoB,QAAQ,YAAY;;AAEzC,eAAY;AACZ,UAAO;aACG,SAAS,OAAO,SAAS,GAAI,GAAE;MACrC,QAAO;;AAEb,QAAO"}
@@ -0,0 +1,12 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/regex.mjs
3
+ const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
4
+ const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
5
+ const UNC_REGEX = /^[/\\]{2}/;
6
+ const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
7
+
8
+ //#endregion
9
+ exports.ABSOLUTE_PATH_REGEX = ABSOLUTE_PATH_REGEX;
10
+ exports.DRIVE_LETTER_REGEX = DRIVE_LETTER_REGEX;
11
+ exports.DRIVE_LETTER_START_REGEX = DRIVE_LETTER_START_REGEX;
12
+ exports.UNC_REGEX = UNC_REGEX;
@@ -0,0 +1,9 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/regex.mjs
2
+ const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
3
+ const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
4
+ const UNC_REGEX = /^[/\\]{2}/;
5
+ const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
6
+
7
+ //#endregion
8
+ export { ABSOLUTE_PATH_REGEX, DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX };
9
+ //# sourceMappingURL=regex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/regex.mjs"],"sourcesContent":["//#region src/regex.ts\nconst DRIVE_LETTER_START_REGEX = /^[A-Z]:\\//i;\nconst DRIVE_LETTER_REGEX = /^[A-Z]:$/i;\nconst UNC_REGEX = /^[/\\\\]{2}/;\nconst ABSOLUTE_PATH_REGEX = /^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^~[/\\\\]|^[A-Z]:[/\\\\]/i;\nconst ROOT_FOLDER_REGEX = /^\\/([A-Z]:)?$/i;\nconst FILE_EXTENSION_REGEX = /\\.[0-9a-z]+$/i;\nconst FULL_FILE_EXTENSION_REGEX = /(\\.d)?\\.[0-9a-z]+(\\.map)?$/i;\nconst PACKAGE_PATH_REGEX = /^@\\w+\\/.*$/;\nconst NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\\w-]+\\/)?[\\w-]+$/;\n\n//#endregion\nexport { ABSOLUTE_PATH_REGEX, 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 };\n//# sourceMappingURL=regex.mjs.map"],"x_google_ignoreList":[0],"mappings":";AACA,MAAM,2BAA2B;AACjC,MAAM,qBAAqB;AAC3B,MAAM,YAAY;AAClB,MAAM,sBAAsB"}
@@ -0,0 +1,15 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/slash.mjs
3
+ /**
4
+ * Replace backslash to slash
5
+ *
6
+ * @param path - The string to replace
7
+ * @returns The string with replaced backslashes
8
+ */
9
+ function slash(path) {
10
+ if (path.startsWith("\\\\?\\")) return path;
11
+ return path.replace(/\\/g, "/");
12
+ }
13
+
14
+ //#endregion
15
+ exports.slash = slash;
@@ -0,0 +1,15 @@
1
+ //#region ../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/slash.mjs
2
+ /**
3
+ * Replace backslash to slash
4
+ *
5
+ * @param path - The string to replace
6
+ * @returns The string with replaced backslashes
7
+ */
8
+ function slash(path) {
9
+ if (path.startsWith("\\\\?\\")) return path;
10
+ return path.replace(/\\/g, "/");
11
+ }
12
+
13
+ //#endregion
14
+ export { slash };
15
+ //# sourceMappingURL=slash.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+path@0.27.4/node_modules/@stryke/path/dist/slash.mjs"],"sourcesContent":["import { isAbsolutePath } from \"./is-type.mjs\";\n\n//#region src/slash.ts\n/**\n* Replace backslash to slash\n*\n* @param path - The string to replace\n* @returns The string with replaced backslashes\n*/\nfunction slash(path) {\n\tif (path.startsWith(\"\\\\\\\\?\\\\\")) return path;\n\treturn path.replace(/\\\\/g, \"/\");\n}\n/**\n* Replace backslash to slash and remove unneeded leading and trailing slashes\n*\n* @param path - The string to replace\n* @returns The string with replaced backslashes\n*/\nfunction formatSlash(path) {\n\tconst formatted = slash(path);\n\treturn isAbsolutePath(formatted) ? formatted.replace(/\\/+$/g, \"\") : formatted.replace(/^\\.\\//g, \"\").replace(/\\/+$/g, \"\");\n}\n\n//#endregion\nexport { formatSlash, slash };\n//# sourceMappingURL=slash.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AASA,SAAS,MAAM,MAAM;AACpB,KAAI,KAAK,WAAW,UAAU,CAAE,QAAO;AACvC,QAAO,KAAK,QAAQ,OAAO,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-deepkit",
3
- "version": "0.11.286",
3
+ "version": "0.11.287",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -90,16 +90,17 @@
90
90
  "files": ["dist/**/*"],
91
91
  "keywords": ["deepkit", "powerlines", "storm-software", "powerlines-plugin"],
92
92
  "dependencies": {
93
- "@powerlines/deepkit": "^0.8.8",
94
- "@powerlines/plugin-tsc": "^0.2.413",
93
+ "@powerlines/deepkit": "^0.8.9",
94
+ "@powerlines/plugin-tsc": "^0.2.414",
95
95
  "@stryke/json": "^0.14.12",
96
- "powerlines": "^0.43.4",
96
+ "powerlines": "^0.43.5",
97
97
  "typescript": "^6.0.3"
98
98
  },
99
99
  "devDependencies": {
100
- "@powerlines/plugin-plugin": "^0.12.356",
100
+ "@powerlines/plugin-plugin": "^0.12.357",
101
101
  "@types/node": "^25.6.0"
102
102
  },
103
103
  "publishConfig": { "access": "public" },
104
- "gitHead": "f7de906d8d1adf17890122f2e5d30fb372dd9983"
104
+ "inlinedDependencies": { "@stryke/path": "0.27.4" },
105
+ "gitHead": "20f2c6b5e4a07b06620c8c98d83bb3b31503c426"
105
106
  }