@powerlines/plugin-tsdown 0.1.204 → 0.1.206

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.
@@ -1,14 +1,14 @@
1
1
  const require_index = require('./index.cjs');
2
2
  let powerlines_lib_utilities_format = require("powerlines/lib/utilities/format");
3
3
 
4
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs
4
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/regex.mjs
5
5
  const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
6
6
  const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
7
7
  const UNC_REGEX = /^[/\\]{2}/;
8
8
  const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
9
9
 
10
10
  //#endregion
11
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs
11
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/slash.mjs
12
12
  /**
13
13
  * Replace backslash to slash
14
14
  *
@@ -21,7 +21,7 @@ function slash(path) {
21
21
  }
22
22
 
23
23
  //#endregion
24
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs
24
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs
25
25
  /**
26
26
  * Check if the path is an absolute path.
27
27
  *
@@ -45,7 +45,7 @@ function isAbsolute(path) {
45
45
  }
46
46
 
47
47
  //#endregion
48
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs
48
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs
49
49
  function normalizeWindowsPath(input = "") {
50
50
  if (!input) return input;
51
51
  return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
@@ -71,23 +71,38 @@ function correctPaths(path) {
71
71
  }
72
72
  /**
73
73
  * Joins all given path segments together using the platform-specific separator as a delimiter.
74
- * The resulting path is normalized to remove any redundant or unnecessary segments.
74
+ *
75
+ * @remarks
76
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { joinPaths } from 'stryke/path';
81
+ *
82
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
83
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
84
+ *
85
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
86
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
87
+ *
88
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
89
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
90
+ *
91
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
92
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
93
+ * ```
75
94
  *
76
95
  * @param segments - The path segments to join.
77
96
  * @returns The joined and normalized path string.
78
97
  */
79
98
  function joinPaths(...segments) {
80
- let path = "";
81
- for (const seg of segments) {
82
- if (!seg) continue;
83
- if (path.length > 0) {
84
- const pathTrailing = path[path.length - 1] === "/";
85
- const segLeading = seg[0] === "/";
86
- if (pathTrailing && segLeading) path += seg.slice(1);
87
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
88
- } else path += seg;
99
+ let result = "";
100
+ for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
101
+ if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
102
+ else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
103
+ else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
89
104
  }
90
- return correctPaths(path);
105
+ return correctPaths(result);
91
106
  }
92
107
  /**
93
108
  * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
@@ -147,7 +162,7 @@ function normalizeString(path, allowAboveRoot) {
147
162
  }
148
163
 
149
164
  //#endregion
150
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs
165
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.mjs
151
166
  const isString = (value) => {
152
167
  try {
153
168
  return typeof value === "string";
@@ -157,7 +172,7 @@ const isString = (value) => {
157
172
  };
158
173
 
159
174
  //#endregion
160
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
175
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs
161
176
  const isNull = (value) => {
162
177
  try {
163
178
  return value === null;
@@ -167,13 +182,13 @@ const isNull = (value) => {
167
182
  };
168
183
 
169
184
  //#endregion
170
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
185
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs
171
186
  const isUndefined = (value) => {
172
187
  return value === void 0;
173
188
  };
174
189
 
175
190
  //#endregion
176
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
191
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs
177
192
  /**
178
193
  * Check if the provided value's type is `null` or `undefined`
179
194
  *
@@ -189,7 +204,7 @@ const isEmpty = (value) => {
189
204
  };
190
205
 
191
206
  //#endregion
192
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
207
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs
193
208
  /**
194
209
  * The inverse of the `isEmpty` function
195
210
  *
@@ -205,7 +220,7 @@ const isSet = (value) => {
205
220
  };
206
221
 
207
222
  //#endregion
208
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs
223
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs
209
224
  /**
210
225
  * Determine if the type is string and is not empty (length greater than zero)
211
226
  *
@@ -1,13 +1,13 @@
1
1
  import { format } from "powerlines/lib/utilities/format";
2
2
 
3
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs
3
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/regex.mjs
4
4
  const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i;
5
5
  const DRIVE_LETTER_REGEX = /^[A-Z]:$/i;
6
6
  const UNC_REGEX = /^[/\\]{2}/;
7
7
  const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i;
8
8
 
9
9
  //#endregion
10
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs
10
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/slash.mjs
11
11
  /**
12
12
  * Replace backslash to slash
13
13
  *
@@ -20,7 +20,7 @@ function slash(path) {
20
20
  }
21
21
 
22
22
  //#endregion
23
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs
23
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs
24
24
  /**
25
25
  * Check if the path is an absolute path.
26
26
  *
@@ -44,7 +44,7 @@ function isAbsolute(path) {
44
44
  }
45
45
 
46
46
  //#endregion
47
- //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs
47
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs
48
48
  function normalizeWindowsPath(input = "") {
49
49
  if (!input) return input;
50
50
  return input.replace(/\\/g, "/").replace(DRIVE_LETTER_START_REGEX, (r) => r.toUpperCase());
@@ -70,23 +70,38 @@ function correctPaths(path) {
70
70
  }
71
71
  /**
72
72
  * Joins all given path segments together using the platform-specific separator as a delimiter.
73
- * The resulting path is normalized to remove any redundant or unnecessary segments.
73
+ *
74
+ * @remarks
75
+ * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * import { joinPaths } from 'stryke/path';
80
+ *
81
+ * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');
82
+ * console.log(fullPath); // Output: 'folder1/folder3/file.txt'
83
+ *
84
+ * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');
85
+ * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'
86
+ *
87
+ * const windowsPath = joinPaths('C:\\', 'Users', 'Public', '..', 'Documents', 'file.txt');
88
+ * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'
89
+ *
90
+ * const uncPath = joinPaths('\\\\Server\\Share', 'Folder', 'File.txt');
91
+ * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'
92
+ * ```
74
93
  *
75
94
  * @param segments - The path segments to join.
76
95
  * @returns The joined and normalized path string.
77
96
  */
78
97
  function joinPaths(...segments) {
79
- let path = "";
80
- for (const seg of segments) {
81
- if (!seg) continue;
82
- if (path.length > 0) {
83
- const pathTrailing = path[path.length - 1] === "/";
84
- const segLeading = seg[0] === "/";
85
- if (pathTrailing && segLeading) path += seg.slice(1);
86
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
87
- } else path += seg;
98
+ let result = "";
99
+ for (const segment of segments) if (segment && slash(segment).replaceAll(/\//g, "") !== ".") {
100
+ if (result) if (slash(segment).replaceAll(/\//g, "") === "..") result = slash(result).replace(/\/+$/, "").replace(/\/*[^/]+$/, "");
101
+ else result = `${slash(result).replace(/\/+$/, "")}/${slash(segment).replace(/^\/+/, "")}`;
102
+ else if (slash(segment).replaceAll(/\//g, "") !== "..") result = segment;
88
103
  }
89
- return correctPaths(path);
104
+ return correctPaths(result);
90
105
  }
91
106
  /**
92
107
  * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
@@ -146,7 +161,7 @@ function normalizeString(path, allowAboveRoot) {
146
161
  }
147
162
 
148
163
  //#endregion
149
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs
164
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.mjs
150
165
  const isString = (value) => {
151
166
  try {
152
167
  return typeof value === "string";
@@ -156,7 +171,7 @@ const isString = (value) => {
156
171
  };
157
172
 
158
173
  //#endregion
159
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs
174
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs
160
175
  const isNull = (value) => {
161
176
  try {
162
177
  return value === null;
@@ -166,13 +181,13 @@ const isNull = (value) => {
166
181
  };
167
182
 
168
183
  //#endregion
169
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs
184
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs
170
185
  const isUndefined = (value) => {
171
186
  return value === void 0;
172
187
  };
173
188
 
174
189
  //#endregion
175
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs
190
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs
176
191
  /**
177
192
  * Check if the provided value's type is `null` or `undefined`
178
193
  *
@@ -188,7 +203,7 @@ const isEmpty = (value) => {
188
203
  };
189
204
 
190
205
  //#endregion
191
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs
206
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs
192
207
  /**
193
208
  * The inverse of the `isEmpty` function
194
209
  *
@@ -204,7 +219,7 @@ const isSet = (value) => {
204
219
  };
205
220
 
206
221
  //#endregion
207
- //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs
222
+ //#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs
208
223
  /**
209
224
  * Determine if the type is string and is not empty (length greater than zero)
210
225
  *
@@ -234,4 +249,4 @@ async function formatPackageJson(context) {
234
249
 
235
250
  //#endregion
236
251
  export { formatPackageJson as t };
237
- //# sourceMappingURL=format-package-json-Cy0hXUxs.mjs.map
252
+ //# sourceMappingURL=format-package-json-DrnPQ10f.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-package-json-DrnPQ10f.mjs","names":[],"sources":["../../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/regex.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/slash.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/is-type.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.4/node_modules/@stryke/path/dist/join-paths.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-string.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-null.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-undefined.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-empty.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.23/node_modules/@stryke/type-checks/dist/is-set-string.mjs","../src/helpers/format-package-json.ts"],"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","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 { 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 { 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","//#region src/is-string.ts\nconst isString = (value) => {\n\ttry {\n\t\treturn typeof value === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isString };\n//# sourceMappingURL=is-string.mjs.map","//#region src/is-null.ts\nconst isNull = (value) => {\n\ttry {\n\t\treturn value === null;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isNull };\n//# sourceMappingURL=is-null.mjs.map","//#region src/is-undefined.ts\nconst isUndefined = (value) => {\n\treturn value === void 0;\n};\n\n//#endregion\nexport { isUndefined };\n//# sourceMappingURL=is-undefined.mjs.map","import { isDate } from \"./is-date.mjs\";\nimport { isFunction } from \"./is-function.mjs\";\nimport { isNull } from \"./is-null.mjs\";\nimport { isNumber } from \"./is-number.mjs\";\nimport { isSymbol } from \"./is-symbol.mjs\";\nimport { isUndefined } from \"./is-undefined.mjs\";\n\n//#region src/is-empty.ts\n/**\n* Check if the provided value's type is `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `null` or `undefined`\n*/\nconst isEmpty = (value) => {\n\ttry {\n\t\treturn isUndefined(value) || isNull(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\nconst isEmptyAnything = (value) => {\n\tif (value === true || value === false) return true;\n\tif (value === null || value === void 0) return true;\n\tif (isNumber(value)) return value === 0;\n\tif (isDate(value)) return Number.isNaN(value.getTime());\n\tif (isFunction(value)) return false;\n\tif (isSymbol(value)) return false;\n\tconst { length } = value;\n\tif (isNumber(length)) return length === 0;\n\tconst { size } = value;\n\tif (isNumber(size)) return size === 0;\n\treturn Object.keys(value).length === 0;\n};\n\n//#endregion\nexport { isEmpty, isEmptyAnything };\n//# sourceMappingURL=is-empty.mjs.map","import { isEmpty } from \"./is-empty.mjs\";\n\n//#region src/is-set.ts\n/**\n* The inverse of the `isEmpty` function\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n*/\nconst isSet = (value) => {\n\ttry {\n\t\treturn !isEmpty(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSet };\n//# sourceMappingURL=is-set.mjs.map","import { isString } from \"./is-string.mjs\";\nimport { isSet } from \"./is-set.mjs\";\n\n//#region src/is-set-string.ts\n/**\n* Determine if the type is string and is not empty (length greater than zero)\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n*/\nconst isSetString = (value) => {\n\ttry {\n\t\treturn isSet(value) && isString(value) && value.length > 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSetString };\n//# sourceMappingURL=is-set-string.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 { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"powerlines/lib/utilities/format\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The Tsdown plugin context.\n */\nexport async function formatPackageJson(context: TsdownPluginContext) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n \"package.json\"\n );\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9],"mappings":";;;AACA,MAAM,2BAA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,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;;;;;ACrHR,MAAM,YAAY,UAAU;AAC3B,KAAI;AACH,SAAO,OAAO,UAAU;SACjB;AACP,SAAO;;;;;;ACJT,MAAM,UAAU,UAAU;AACzB,KAAI;AACH,SAAO,UAAU;SACV;AACP,SAAO;;;;;;ACJT,MAAM,eAAe,UAAU;AAC9B,QAAO,UAAU,KAAK;;;;;;;;;;;ACYvB,MAAM,WAAW,UAAU;AAC1B,KAAI;AACH,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACnC;AACP,SAAO;;;;;;;;;;;;ACTT,MAAM,SAAS,UAAU;AACxB,KAAI;AACH,SAAO,CAAC,QAAQ,MAAM;SACf;AACP,SAAO;;;;;;;;;;;;ACHT,MAAM,eAAe,UAAU;AAC9B,KAAI;AACH,SAAO,MAAM,MAAM,IAAI,SAAS,MAAM,IAAI,MAAM,SAAS;SAClD;AACP,SAAO;;;;;;;;;;;ACcT,eAAsB,kBAAkB,SAA8B;CACpE,MAAM,kBAAkB,UACtB,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,aACf,eACD;CACD,MAAM,kBAAkB,MAAM,QAAQ,GAAG,KAAK,gBAAgB;AAC9D,KAAI,YAAY,gBAAgB,CAC9B,OAAM,QAAQ,GAAG,MACf,iBACA,MAAM,OAAO,SAAS,iBAAiB,gBAAgB,CACxD"}
@@ -1,3 +1,3 @@
1
- const require_format_package_json = require('../format-package-json-Dt4gyoUq.cjs');
1
+ const require_format_package_json = require('../format-package-json-BfJL_TJm.cjs');
2
2
 
3
3
  exports.formatPackageJson = require_format_package_json.formatPackageJson;
@@ -1,3 +1,3 @@
1
- import { t as formatPackageJson } from "../format-package-json-Cy0hXUxs.mjs";
1
+ import { t as formatPackageJson } from "../format-package-json-DrnPQ10f.mjs";
2
2
 
3
3
  export { formatPackageJson };
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  }) : target, mod));
27
27
 
28
28
  //#endregion
29
- const require_format_package_json = require('./format-package-json-Dt4gyoUq.cjs');
29
+ const require_format_package_json = require('./format-package-json-BfJL_TJm.cjs');
30
30
  const require_unplugin = require('./unplugin-DWU1VqQz.cjs');
31
31
  require('./helpers-yB1XkvQI.cjs');
32
32
  require('./plugin-Ckx8qAq8.cjs');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as formatPackageJson } from "./format-package-json-Cy0hXUxs.mjs";
1
+ import { t as formatPackageJson } from "./format-package-json-DrnPQ10f.mjs";
2
2
  import { t as createTsdownPlugin } from "./unplugin-0Zevy5n4.mjs";
3
3
  import "./helpers-y2jvHwgF.mjs";
4
4
  import "./plugin-B0q2kj8i.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-tsdown",
3
- "version": "0.1.204",
3
+ "version": "0.1.206",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -132,15 +132,15 @@
132
132
  "keywords": ["tsdown", "powerlines", "storm-software", "powerlines-plugin"],
133
133
  "dependencies": {
134
134
  "defu": "^6.1.4",
135
- "powerlines": "^0.38.18",
135
+ "powerlines": "^0.38.20",
136
136
  "tsdown": "0.17.0-beta.5",
137
137
  "unplugin": "3.0.0-beta.3"
138
138
  },
139
139
  "devDependencies": {
140
- "@powerlines/plugin-plugin": "^0.12.202",
140
+ "@powerlines/plugin-plugin": "^0.12.204",
141
141
  "@types/node": "^24.10.9"
142
142
  },
143
143
  "publishConfig": { "access": "public" },
144
144
  "types": "./dist/index.d.cts",
145
- "gitHead": "e29af8437f93d198bc9f140cd38a6a06b1634508"
145
+ "gitHead": "54a89805dd69f77013ebbd3282232563d7af4e7b"
146
146
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-package-json-Cy0hXUxs.mjs","names":[],"sources":["../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/regex.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/slash.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-type.mjs","../../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/join-paths.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-string.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-null.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-undefined.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-empty.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set.mjs","../../../node_modules/.pnpm/@stryke+type-checks@0.5.22/node_modules/@stryke/type-checks/dist/is-set-string.mjs","../src/helpers/format-package-json.ts"],"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","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 { 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 { DRIVE_LETTER_REGEX, DRIVE_LETTER_START_REGEX, UNC_REGEX } from \"./regex.mjs\";\nimport { isAbsolute } from \"./is-type.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* The resulting path is normalized to remove any redundant or unnecessary segments.\n*\n* @param segments - The path segments to join.\n* @returns The joined and normalized path string.\n*/\nfunction joinPaths(...segments) {\n\tlet path = \"\";\n\tfor (const seg of segments) {\n\t\tif (!seg) continue;\n\t\tif (path.length > 0) {\n\t\t\tconst pathTrailing = path[path.length - 1] === \"/\";\n\t\t\tconst segLeading = seg[0] === \"/\";\n\t\t\tif (pathTrailing && segLeading) path += seg.slice(1);\n\t\t\telse path += pathTrailing || segLeading ? seg : `/${seg}`;\n\t\t} else path += seg;\n\t}\n\treturn correctPaths(path);\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","//#region src/is-string.ts\nconst isString = (value) => {\n\ttry {\n\t\treturn typeof value === \"string\";\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isString };\n//# sourceMappingURL=is-string.mjs.map","//#region src/is-null.ts\nconst isNull = (value) => {\n\ttry {\n\t\treturn value === null;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isNull };\n//# sourceMappingURL=is-null.mjs.map","//#region src/is-undefined.ts\nconst isUndefined = (value) => {\n\treturn value === void 0;\n};\n\n//#endregion\nexport { isUndefined };\n//# sourceMappingURL=is-undefined.mjs.map","import { isDate } from \"./is-date.mjs\";\nimport { isFunction } from \"./is-function.mjs\";\nimport { isNull } from \"./is-null.mjs\";\nimport { isNumber } from \"./is-number.mjs\";\nimport { isSymbol } from \"./is-symbol.mjs\";\nimport { isUndefined } from \"./is-undefined.mjs\";\n\n//#region src/is-empty.ts\n/**\n* Check if the provided value's type is `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `null` or `undefined`\n*/\nconst isEmpty = (value) => {\n\ttry {\n\t\treturn isUndefined(value) || isNull(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\nconst isEmptyAnything = (value) => {\n\tif (value === true || value === false) return true;\n\tif (value === null || value === void 0) return true;\n\tif (isNumber(value)) return value === 0;\n\tif (isDate(value)) return Number.isNaN(value.getTime());\n\tif (isFunction(value)) return false;\n\tif (isSymbol(value)) return false;\n\tconst { length } = value;\n\tif (isNumber(length)) return length === 0;\n\tconst { size } = value;\n\tif (isNumber(size)) return size === 0;\n\treturn Object.keys(value).length === 0;\n};\n\n//#endregion\nexport { isEmpty, isEmptyAnything };\n//# sourceMappingURL=is-empty.mjs.map","import { isEmpty } from \"./is-empty.mjs\";\n\n//#region src/is-set.ts\n/**\n* The inverse of the `isEmpty` function\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is **NOT** of type `null` or `undefined`\n*/\nconst isSet = (value) => {\n\ttry {\n\t\treturn !isEmpty(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSet };\n//# sourceMappingURL=is-set.mjs.map","import { isString } from \"./is-string.mjs\";\nimport { isSet } from \"./is-set.mjs\";\n\n//#region src/is-set-string.ts\n/**\n* Determine if the type is string and is not empty (length greater than zero)\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `string` and length greater than zero\n*/\nconst isSetString = (value) => {\n\ttry {\n\t\treturn isSet(value) && isString(value) && value.length > 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isSetString };\n//# sourceMappingURL=is-set-string.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 { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"powerlines/lib/utilities/format\";\nimport { TsdownPluginContext } from \"../types/plugin\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The Tsdown plugin context.\n */\nexport async function formatPackageJson(context: TsdownPluginContext) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n \"package.json\"\n );\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9],"mappings":";;;AACA,MAAM,2BAA2B;AACjC,MAAM,qBAAqB;AAC3B,MAAM,YAAY;AAClB,MAAM,sBAAsB;;;;;;;;;;ACK5B,SAAS,MAAM,MAAM;AACpB,KAAI,KAAK,WAAW,UAAU,CAAE,QAAO;AACvC,QAAO,KAAK,QAAQ,OAAO,IAAI;;;;;;;;;;;ACDhC,SAAS,eAAe,MAAM;AAC7B,QA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