@powerlines/plugin-deepkit 0.11.367 → 0.11.369
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/dist/index.cjs +7 -7
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@ let _powerlines_deepkit_transformer = require("@powerlines/deepkit/transformer")
|
|
|
31
31
|
let _powerlines_plugin_tsc = require("@powerlines/plugin-tsc");
|
|
32
32
|
_powerlines_plugin_tsc = __toESM(_powerlines_plugin_tsc, 1);
|
|
33
33
|
|
|
34
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
34
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/cwd.mjs
|
|
35
35
|
/**
|
|
36
36
|
* Get the current working directory.
|
|
37
37
|
*
|
|
@@ -46,14 +46,14 @@ function cwd() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
//#endregion
|
|
49
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
49
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/regex.mjs
|
|
50
50
|
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
51
51
|
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
52
52
|
const UNC_REGEX = /^[/\\]{2}/;
|
|
53
53
|
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
54
54
|
|
|
55
55
|
//#endregion
|
|
56
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
56
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-type.mjs
|
|
57
57
|
/**
|
|
58
58
|
* Check if the path is an absolute path.
|
|
59
59
|
*
|
|
@@ -77,7 +77,7 @@ function isAbsolute(path) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
80
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/slash.mjs
|
|
81
81
|
/**
|
|
82
82
|
* Replace backslash to slash
|
|
83
83
|
*
|
|
@@ -90,7 +90,7 @@ function slash(path) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
//#endregion
|
|
93
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
93
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-parent-path.mjs
|
|
94
94
|
/**
|
|
95
95
|
* Check if a given path is a parent of another path.
|
|
96
96
|
*
|
|
@@ -119,7 +119,7 @@ function isParentPath(childPath, parentPath) {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
//#endregion
|
|
122
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
122
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/join-paths.mjs
|
|
123
123
|
function normalizeWindowsPath(input = "") {
|
|
124
124
|
if (!input) return input;
|
|
125
125
|
return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
@@ -236,7 +236,7 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
//#endregion
|
|
239
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
239
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/append.mjs
|
|
240
240
|
/**
|
|
241
241
|
* If not already a parent path, append the base path from the beginning of the given child path.
|
|
242
242
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import "./types/index.mjs";
|
|
|
2
2
|
import { createDeclarationTransformer, createTransformer } from "@powerlines/deepkit/transformer";
|
|
3
3
|
import tsc from "@powerlines/plugin-tsc";
|
|
4
4
|
|
|
5
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
5
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/cwd.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Get the current working directory.
|
|
8
8
|
*
|
|
@@ -17,14 +17,14 @@ function cwd() {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
20
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/regex.mjs
|
|
21
21
|
const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
|
|
22
22
|
const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
|
|
23
23
|
const UNC_REGEX = /^[/\\]{2}/;
|
|
24
24
|
const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
27
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-type.mjs
|
|
28
28
|
/**
|
|
29
29
|
* Check if the path is an absolute path.
|
|
30
30
|
*
|
|
@@ -48,7 +48,7 @@ function isAbsolute(path) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
//#endregion
|
|
51
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
51
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/slash.mjs
|
|
52
52
|
/**
|
|
53
53
|
* Replace backslash to slash
|
|
54
54
|
*
|
|
@@ -61,7 +61,7 @@ function slash(path) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
64
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-parent-path.mjs
|
|
65
65
|
/**
|
|
66
66
|
* Check if a given path is a parent of another path.
|
|
67
67
|
*
|
|
@@ -90,7 +90,7 @@ function isParentPath(childPath, parentPath) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
//#endregion
|
|
93
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
93
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/join-paths.mjs
|
|
94
94
|
function normalizeWindowsPath(input = "") {
|
|
95
95
|
if (!input) return input;
|
|
96
96
|
return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
|
|
@@ -207,7 +207,7 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
//#endregion
|
|
210
|
-
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.
|
|
210
|
+
//#region ../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/append.mjs
|
|
211
211
|
/**
|
|
212
212
|
* If not already a parent path, append the base path from the beginning of the given child path.
|
|
213
213
|
*
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/cwd.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/regex.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/is-type.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/slash.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/is-parent-path.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/join-paths.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.1_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_fa6bb8145aaa75ab4b9691c58448d03c/node_modules/@stryke/path/dist/append.mjs","../src/index.ts"],"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","//#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","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","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","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","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","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","/* -------------------------------------------------------------------\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({ order: \"pre\", ...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.config.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"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;AASA,SAAS,MAAM;AACd,KAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,QAAQ,WAAY,QAAO,QAAQ,KAAK,CAAC,QAAQ,OAAO,IAAI;AACjH,QAAO;;;;;ACVR,MAAM,2BAA2B;AACjC,MAAM,qBAAqB;AAC3B,MAAM,YAAY;AAClB,MAAM,sBAAsB;;;;;;;;;;ACM5B,SAAS,eAAe,MAAM;AAC7B,QAAO,oBAAoB,KAAK,MAAM,KAAK,CAAC;;;;;;;;;;;AAW7C,SAAS,WAAW,MAAM;AACzB,QAAO,eAAe,KAAK;;;;;;;;;;;ACd5B,SAAS,MAAM,MAAM;AACpB,KAAI,KAAK,WAAW,UAAU,CAAE,QAAO;AACvC,QAAO,KAAK,QAAQ,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;ACahC,SAAS,aAAa,WAAW,YAAY;CAC5C,MAAM,kBAAkB,MAAM,UAAU,WAAW,OAAO,IAAI,CAAC,QAA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","names":[],"sources":["../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/cwd.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/regex.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-type.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/slash.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/is-parent-path.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/join-paths.mjs","../../../../node_modules/.pnpm/@stryke+path@0.29.3_@nx+jest@22.7.2_@babel+traverse@7.29.0_@swc-node+register@1.11.1_@e_72513f9904a47ec2534741dc6502aef0/node_modules/@stryke/path/dist/append.mjs","../src/index.ts"],"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","//#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","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","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","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","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","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","/* -------------------------------------------------------------------\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({ order: \"pre\", ...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.config.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"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;AASA,SAAS,MAAM;AACd,KAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,QAAQ,WAAY,QAAO,QAAQ,KAAK,CAAC,QAAQ,OAAO,IAAI;AACjH,QAAO;;;;;ACVR,MAAM,2BAA2B;AACjC,MAAM,qBAAqB;AAC3B,MAAM,YAAY;AAClB,MAAM,sBAAsB;;;;;;;;;;ACM5B,SAAS,eAAe,MAAM;AAC7B,QAAO,oBAAoB,KAAK,MAAM,KAAK,CAAC;;;;;;;;;;;AAW7C,SAAS,WAAW,MAAM;AACzB,QAAO,eAAe,KAAK;;;;;;;;;;;ACd5B,SAAS,MAAM,MAAM;AACpB,KAAI,KAAK,WAAW,UAAU,CAAE,QAAO;AACvC,QAA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AO,QAAQ,CAC7C;AACD,SAAK,OAAO,IAAI,aAAa,MAAO,KAClC,6BAA6B,MAAM,KAAK,OAAO,QAAQ,CACxD;;GAEJ;EACF,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-deepkit",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.369",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"repository": {
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"files": ["dist/**/*"],
|
|
58
58
|
"keywords": ["deepkit", "powerlines", "storm-software", "powerlines-plugin"],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@powerlines/deepkit": "^0.9.
|
|
61
|
-
"@powerlines/plugin-tsc": "^0.3.
|
|
60
|
+
"@powerlines/deepkit": "^0.9.6",
|
|
61
|
+
"@powerlines/plugin-tsc": "^0.3.23",
|
|
62
62
|
"@stryke/json": "^0.15.0",
|
|
63
|
-
"powerlines": "^0.47.
|
|
63
|
+
"powerlines": "^0.47.26",
|
|
64
64
|
"typescript": "^6.0.3"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
67
|
+
"@powerlines/plugin-plugin": "^0.12.438",
|
|
68
68
|
"@types/node": "^25.8.0"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": { "access": "public" },
|
|
71
71
|
"inlinedDependencies": { "@stryke/path": "0.29.3" },
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "562b6479b3ad104d0e6e8879448bb2a7450a7660"
|
|
73
73
|
}
|