@socketsecurity/lib 1.0.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/abort.js.map +2 -2
  3. package/dist/argv/parse.js.map +2 -2
  4. package/dist/arrays.d.ts +143 -0
  5. package/dist/arrays.js.map +2 -2
  6. package/dist/bin.js +1 -4
  7. package/dist/bin.js.map +2 -2
  8. package/dist/cacache.d.ts +0 -2
  9. package/dist/cacache.js +0 -1
  10. package/dist/cacache.js.map +2 -2
  11. package/dist/cache-with-ttl.js.map +2 -2
  12. package/dist/dlx.js.map +2 -2
  13. package/dist/external/@yarnpkg/extensions.d.ts +0 -1
  14. package/dist/external/cacache.d.ts +0 -7
  15. package/dist/external/debug.d.ts +0 -3
  16. package/dist/external/fast-sort.d.ts +0 -1
  17. package/dist/external/libnpmpack.d.ts +0 -1
  18. package/dist/external/make-fetch-happen.d.ts +0 -1
  19. package/dist/external/pacote.d.ts +0 -5
  20. package/dist/external/semver.d.ts +0 -1
  21. package/dist/external/validate-npm-package-name.js +1 -1
  22. package/dist/external/yargs-parser.d.ts +0 -1
  23. package/dist/external/yoctocolors-cjs.js +1 -1
  24. package/dist/external/zod.js +9 -9
  25. package/dist/fs.d.ts +595 -23
  26. package/dist/fs.js.map +2 -2
  27. package/dist/git.d.ts +488 -41
  28. package/dist/git.js.map +2 -2
  29. package/dist/github.d.ts +361 -12
  30. package/dist/github.js.map +2 -2
  31. package/dist/http-request.d.ts +463 -4
  32. package/dist/http-request.js.map +2 -2
  33. package/dist/json.d.ts +177 -4
  34. package/dist/json.js.map +2 -2
  35. package/dist/logger.d.ts +823 -70
  36. package/dist/logger.js +654 -51
  37. package/dist/logger.js.map +2 -2
  38. package/dist/objects.d.ts +386 -10
  39. package/dist/objects.js.map +2 -2
  40. package/dist/path.d.ts +270 -6
  41. package/dist/path.js.map +2 -2
  42. package/dist/promises.d.ts +432 -27
  43. package/dist/promises.js +3 -0
  44. package/dist/promises.js.map +2 -2
  45. package/dist/signal-exit.js.map +2 -2
  46. package/dist/sorts.js.map +2 -2
  47. package/dist/spawn.d.ts +242 -33
  48. package/dist/spawn.js.map +2 -2
  49. package/dist/spinner.d.ts +260 -20
  50. package/dist/spinner.js +201 -63
  51. package/dist/spinner.js.map +2 -2
  52. package/dist/stdio/clear.d.ts +130 -9
  53. package/dist/stdio/clear.js.map +2 -2
  54. package/dist/stdio/divider.d.ts +106 -10
  55. package/dist/stdio/divider.js +10 -0
  56. package/dist/stdio/divider.js.map +2 -2
  57. package/dist/stdio/footer.d.ts +70 -3
  58. package/dist/stdio/footer.js.map +2 -2
  59. package/dist/stdio/header.d.ts +93 -12
  60. package/dist/stdio/header.js.map +2 -2
  61. package/dist/stdio/mask.d.ts +82 -14
  62. package/dist/stdio/mask.js +25 -4
  63. package/dist/stdio/mask.js.map +2 -2
  64. package/dist/stdio/progress.d.ts +112 -15
  65. package/dist/stdio/progress.js +43 -3
  66. package/dist/stdio/progress.js.map +2 -2
  67. package/dist/stdio/prompts.d.ts +95 -5
  68. package/dist/stdio/prompts.js.map +2 -2
  69. package/dist/stdio/stderr.d.ts +114 -11
  70. package/dist/stdio/stderr.js.map +2 -2
  71. package/dist/stdio/stdout.d.ts +107 -11
  72. package/dist/stdio/stdout.js.map +2 -2
  73. package/dist/strings.d.ts +357 -28
  74. package/dist/strings.js.map +2 -2
  75. package/dist/suppress-warnings.js.map +2 -2
  76. package/dist/validation/json-parser.d.ts +226 -7
  77. package/dist/validation/json-parser.js.map +2 -2
  78. package/dist/validation/types.d.ts +114 -12
  79. package/dist/validation/types.js.map +1 -1
  80. package/package.json +5 -3
package/dist/path.d.ts CHANGED
@@ -1,5 +1,23 @@
1
1
  /**
2
2
  * Check if a path contains node_modules directory.
3
+ *
4
+ * Detects whether a given path includes a `node_modules` directory segment.
5
+ * This is useful for identifying npm package dependencies and filtering
6
+ * dependency-related paths.
7
+ *
8
+ * The check matches `node_modules` appearing as a complete path segment,
9
+ * ensuring it is either at the start, end, or surrounded by path separators.
10
+ *
11
+ * @param {string | Buffer | URL} pathLike - The path to check
12
+ * @returns {boolean} `true` if the path contains `node_modules`, `false` otherwise
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * isNodeModules('/project/node_modules/package') // true
17
+ * isNodeModules('node_modules/package/index.js') // true
18
+ * isNodeModules('/src/my_node_modules_backup') // false
19
+ * isNodeModules('/project/src/index.js') // false
20
+ * ```
3
21
  */
4
22
  /*@__NO_SIDE_EFFECTS__*/
5
23
  export declare function isNodeModules(pathLike: string | Buffer | URL): boolean;
@@ -28,47 +46,293 @@ export declare function isNodeModules(pathLike: string | Buffer | URL): boolean;
28
46
  * - Examples: '\Windows', '\\.\device'
29
47
  * - Note: Single backslash paths are relative to current drive
30
48
  *
31
- * Examples:
32
- * - isAbsolute('/home/user') true (POSIX)
33
- * - isAbsolute('C:\\Windows') → true (Windows drive letter)
34
- * - isAbsolute('\\server\\share') → true (Windows UNC)
35
- * - isAbsolute('../relative') → false
36
- * - isAbsolute('relative/path') → false
49
+ * @param {string | Buffer | URL} pathLike - The path to check
50
+ * @returns {boolean} `true` if the path is absolute, `false` otherwise
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * // POSIX paths
55
+ * isAbsolute('/home/user') // true
56
+ * isAbsolute('/usr/bin/node') // true
57
+ *
58
+ * // Windows paths
59
+ * isAbsolute('C:\\Windows') // true
60
+ * isAbsolute('D:/data') // true
61
+ * isAbsolute('\\\\server\\share') // true
62
+ *
63
+ * // Relative paths
64
+ * isAbsolute('../relative') // false
65
+ * isAbsolute('relative/path') // false
66
+ * isAbsolute('.') // false
67
+ * ```
37
68
  */
38
69
  /*@__NO_SIDE_EFFECTS__*/
39
70
  export declare function isAbsolute(pathLike: string | Buffer | URL): boolean;
40
71
  /**
41
72
  * Check if a value is a valid file path (absolute or relative).
73
+ *
74
+ * Determines whether a given value represents a valid file system path.
75
+ * This function distinguishes between file paths and other string formats
76
+ * like package names, URLs, or bare module specifiers.
77
+ *
78
+ * Valid paths include:
79
+ * - Absolute paths (e.g., `/usr/bin`, `C:\Windows`)
80
+ * - Relative paths with separators (e.g., `./src`, `../lib`)
81
+ * - Special relative paths (`.`, `..`)
82
+ * - Paths starting with `@` that have subpaths (e.g., `@scope/name/file`)
83
+ *
84
+ * Not considered paths:
85
+ * - URLs with protocols (e.g., `http://`, `file://`, `git:`)
86
+ * - Bare package names (e.g., `lodash`, `react`)
87
+ * - Scoped package names without subpaths (e.g., `@scope/name`)
88
+ *
89
+ * @param {string | Buffer | URL} pathLike - The value to check
90
+ * @returns {boolean} `true` if the value is a valid file path, `false` otherwise
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * // Valid paths
95
+ * isPath('/absolute/path') // true
96
+ * isPath('./relative/path') // true
97
+ * isPath('../parent/dir') // true
98
+ * isPath('.') // true
99
+ * isPath('..') // true
100
+ * isPath('@scope/name/subpath') // true
101
+ * isPath('C:\\Windows') // true (Windows)
102
+ *
103
+ * // Not paths
104
+ * isPath('lodash') // false - bare package name
105
+ * isPath('@scope/package') // false - scoped package name
106
+ * isPath('http://example.com') // false - URL
107
+ * isPath('file://path') // false - file URL
108
+ * isPath('') // false - empty string
109
+ * ```
42
110
  */
43
111
  /*@__NO_SIDE_EFFECTS__*/
44
112
  export declare function isPath(pathLike: string | Buffer | URL): boolean;
45
113
  /**
46
114
  * Check if a path is relative.
115
+ *
116
+ * Determines whether a given path is relative (i.e., not absolute). A path
117
+ * is considered relative if it does not specify a location from the root of
118
+ * the file system.
119
+ *
120
+ * Relative paths include:
121
+ * - Paths starting with `.` or `..` (e.g., `./src`, `../lib`)
122
+ * - Paths without leading separators (e.g., `src/file.js`)
123
+ * - Empty strings (treated as relative)
124
+ *
125
+ * @param {string | Buffer | URL} pathLike - The path to check
126
+ * @returns {boolean} `true` if the path is relative, `false` if absolute
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * // Relative paths
131
+ * isRelative('./src/index.js') // true
132
+ * isRelative('../lib/util.js') // true
133
+ * isRelative('src/file.js') // true
134
+ * isRelative('') // true
135
+ *
136
+ * // Absolute paths
137
+ * isRelative('/home/user') // false
138
+ * isRelative('C:\\Windows') // false (Windows)
139
+ * isRelative('\\\\server\\share') // false (Windows UNC)
140
+ * ```
47
141
  */
48
142
  /*@__NO_SIDE_EFFECTS__*/
49
143
  export declare function isRelative(pathLike: string | Buffer | URL): boolean;
50
144
  /**
51
145
  * Normalize a path by converting backslashes to forward slashes and collapsing segments.
146
+ *
147
+ * This function performs several normalization operations:
148
+ * - Converts all backslashes (`\`) to forward slashes (`/`)
149
+ * - Collapses repeated slashes into single slashes
150
+ * - Resolves `.` (current directory) segments
151
+ * - Resolves `..` (parent directory) segments
152
+ * - Preserves UNC path prefixes (`//server/share`)
153
+ * - Preserves Windows namespace prefixes (`//./`, `//?/`)
154
+ * - Returns `.` for empty or collapsed paths
155
+ *
156
+ * Special handling:
157
+ * - UNC paths: Maintains double leading slashes for `//server/share` format
158
+ * - Windows namespaces: Preserves `//./` and `//?/` prefixes
159
+ * - Leading `..` segments: Preserved in relative paths without prefix
160
+ * - Trailing components: Properly handled when resolving `..`
161
+ *
162
+ * @param {string | Buffer | URL} pathLike - The path to normalize
163
+ * @returns {string} The normalized path with forward slashes and collapsed segments
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * // Basic normalization
168
+ * normalizePath('foo/bar//baz') // 'foo/bar/baz'
169
+ * normalizePath('foo/./bar') // 'foo/bar'
170
+ * normalizePath('foo/bar/../baz') // 'foo/baz'
171
+ *
172
+ * // Windows paths
173
+ * normalizePath('C:\\Users\\John\\file.txt') // 'C:/Users/John/file.txt'
174
+ * normalizePath('foo\\bar\\baz') // 'foo/bar/baz'
175
+ *
176
+ * // UNC paths
177
+ * normalizePath('\\\\server\\share\\file') // '//server/share/file'
178
+ *
179
+ * // Edge cases
180
+ * normalizePath('') // '.'
181
+ * normalizePath('.') // '.'
182
+ * normalizePath('..') // '..'
183
+ * normalizePath('///foo///bar///') // '/foo/bar'
184
+ * normalizePath('foo/../..') // '..'
185
+ * ```
52
186
  */
53
187
  /*@__NO_SIDE_EFFECTS__*/
54
188
  export declare function normalizePath(pathLike: string | Buffer | URL): string;
55
189
  /**
56
190
  * Convert a path-like value to a string.
191
+ *
192
+ * Converts various path-like types (string, Buffer, URL) into a normalized
193
+ * string representation. This function handles different input formats and
194
+ * provides consistent string output for path operations.
195
+ *
196
+ * Supported input types:
197
+ * - `string`: Returned as-is
198
+ * - `Buffer`: Decoded as UTF-8 string
199
+ * - `URL`: Converted using `fileURLToPath()`, with fallback for malformed URLs
200
+ * - `null` / `undefined`: Returns empty string
201
+ *
202
+ * URL handling:
203
+ * - Valid file URLs are converted via `url.fileURLToPath()`
204
+ * - Malformed URLs fall back to pathname extraction with decoding
205
+ * - Windows drive letters in URLs are handled specially
206
+ * - Percent-encoded characters are decoded (e.g., `%20` becomes space)
207
+ *
208
+ * @param {string | Buffer | URL | null | undefined} pathLike - The path-like value to convert
209
+ * @returns {string} The string representation of the path, or empty string for null/undefined
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * // String input
214
+ * pathLikeToString('/home/user') // '/home/user'
215
+ *
216
+ * // Buffer input
217
+ * pathLikeToString(Buffer.from('/tmp/file')) // '/tmp/file'
218
+ *
219
+ * // URL input
220
+ * pathLikeToString(new URL('file:///home/user')) // '/home/user'
221
+ * pathLikeToString(new URL('file:///C:/Windows')) // 'C:/Windows' (Windows)
222
+ *
223
+ * // Null/undefined input
224
+ * pathLikeToString(null) // ''
225
+ * pathLikeToString(undefined) // ''
226
+ *
227
+ * // Percent-encoded URLs
228
+ * pathLikeToString(new URL('file:///path%20with%20spaces')) // '/path with spaces'
229
+ * ```
57
230
  */
58
231
  /*@__NO_SIDE_EFFECTS__*/
59
232
  export declare function pathLikeToString(pathLike: string | Buffer | URL | null | undefined): string;
60
233
  /**
61
234
  * Split a path into an array of segments.
235
+ *
236
+ * Divides a path into individual components by splitting on path separators
237
+ * (both forward slashes and backslashes). This is useful for path traversal,
238
+ * analysis, and manipulation.
239
+ *
240
+ * The function handles:
241
+ * - Forward slashes (`/`) on all platforms
242
+ * - Backslashes (`\`) on Windows
243
+ * - Mixed separators in a single path
244
+ * - Empty paths (returns empty array)
245
+ *
246
+ * Note: The resulting array may contain empty strings if the path has leading,
247
+ * trailing, or consecutive separators (e.g., `/foo//bar/` becomes `['', 'foo', '', 'bar', '']`).
248
+ *
249
+ * @param {string | Buffer | URL} pathLike - The path to split
250
+ * @returns {string[]} Array of path segments, or empty array for empty paths
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * // POSIX paths
255
+ * splitPath('/home/user/file.txt') // ['', 'home', 'user', 'file.txt']
256
+ * splitPath('src/lib/util.js') // ['src', 'lib', 'util.js']
257
+ *
258
+ * // Windows paths
259
+ * splitPath('C:\\Users\\John') // ['C:', 'Users', 'John']
260
+ * splitPath('folder\\file.txt') // ['folder', 'file.txt']
261
+ *
262
+ * // Mixed separators
263
+ * splitPath('path/to\\file') // ['path', 'to', 'file']
264
+ *
265
+ * // Edge cases
266
+ * splitPath('') // []
267
+ * splitPath('/') // ['', '']
268
+ * splitPath('/foo//bar/') // ['', 'foo', '', 'bar', '']
269
+ * ```
62
270
  */
63
271
  /*@__NO_SIDE_EFFECTS__*/
64
272
  export declare function splitPath(pathLike: string | Buffer | URL): string[];
65
273
  /**
66
274
  * Remove leading ./ or ../ from a path.
275
+ *
276
+ * Strips the `./` or `.\` prefix from relative paths. This is useful for
277
+ * normalizing paths when the current directory reference is implicit or
278
+ * unwanted.
279
+ *
280
+ * Note: This function only removes a single leading `./` or `.\`. It does
281
+ * not remove `../` prefixes or process the rest of the path.
282
+ *
283
+ * @param {string | Buffer | URL} pathLike - The path to process
284
+ * @returns {string} The path without leading `./` or `.\`, or unchanged if no such prefix
285
+ *
286
+ * @example
287
+ * ```typescript
288
+ * // Remove ./ prefix
289
+ * trimLeadingDotSlash('./src/index.js') // 'src/index.js'
290
+ * trimLeadingDotSlash('.\\src\\file.txt') // 'src\\file.txt'
291
+ *
292
+ * // Preserve ../ prefix
293
+ * trimLeadingDotSlash('../lib/util.js') // '../lib/util.js'
294
+ *
295
+ * // No change for other paths
296
+ * trimLeadingDotSlash('/absolute/path') // '/absolute/path'
297
+ * trimLeadingDotSlash('relative/path') // 'relative/path'
298
+ * trimLeadingDotSlash('.') // '.'
299
+ * ```
67
300
  */
68
301
  /*@__NO_SIDE_EFFECTS__*/
69
302
  export declare function trimLeadingDotSlash(pathLike: string | Buffer | URL): string;
70
303
  /**
71
304
  * Get the relative path from one path to another.
305
+ *
306
+ * Computes the relative path from `from` to `to` and normalizes the result.
307
+ * This is a convenience wrapper around the `relative()` function that adds
308
+ * path normalization (converting separators and collapsing segments).
309
+ *
310
+ * The function:
311
+ * 1. Calculates the relative path using `relative()`
312
+ * 2. Normalizes the result using `normalizePath()`
313
+ * 3. Preserves empty strings (same path) without converting to `.`
314
+ *
315
+ * @param {string} from - The source path (starting point)
316
+ * @param {string} to - The destination path (target)
317
+ * @returns {string} The normalized relative path from `from` to `to`, or empty string if paths are identical
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * // Basic usage
322
+ * relativeResolve('/foo/bar', '/foo/baz') // '../baz'
323
+ * relativeResolve('/foo/bar/baz', '/foo') // '../..'
324
+ * relativeResolve('/foo', '/foo/bar') // 'bar'
325
+ *
326
+ * // Same paths
327
+ * relativeResolve('/foo/bar', '/foo/bar') // ''
328
+ *
329
+ * // Windows paths (normalized)
330
+ * relativeResolve('C:\\foo\\bar', 'C:\\foo\\baz') // '../baz'
331
+ *
332
+ * // With normalization
333
+ * relativeResolve('/foo/./bar', '/foo/baz') // '../baz'
334
+ * relativeResolve('/foo/bar/../baz', '/foo/qux') // '../qux'
335
+ * ```
72
336
  */
73
337
  /*@__NO_SIDE_EFFECTS__*/
74
338
  export declare function relativeResolve(from: string, to: string): string;
package/dist/path.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/path.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Path manipulation utilities with cross-platform support.\n * Provides path normalization, validation, and file extension handling.\n */\n\nimport { WIN32 } from '#constants/platform'\n\nimport { search } from './strings'\n\n// Character code constants.\n// '\\'\nconst CHAR_BACKWARD_SLASH = 92\n// ':'\nconst CHAR_COLON = 58\n// '/'\nconst CHAR_FORWARD_SLASH = 47\n// 'a'\nconst CHAR_LOWERCASE_A = 97\n// 'z'\nconst CHAR_LOWERCASE_Z = 122\n// 'A'\nconst CHAR_UPPERCASE_A = 65\n// 'Z'\nconst CHAR_UPPERCASE_Z = 90\n\n// Regular expressions.\nconst slashRegExp = /[/\\\\]/\nconst nodeModulesPathRegExp = /(?:^|[/\\\\])node_modules(?:[/\\\\]|$)/\n\n/**\n * Check if a character code represents a path separator.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction isPathSeparator(code: number): boolean {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH\n}\n\n/**\n * Check if a character code represents a Windows device root letter.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction isWindowsDeviceRoot(code: number): boolean {\n return (\n (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||\n (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z)\n )\n}\n\nlet _buffer: typeof import('node:buffer') | undefined\n/**\n * Lazily load the buffer module.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getBuffer() {\n if (_buffer === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _buffer = /*@__PURE__*/ require('node:buffer')\n }\n return _buffer as typeof import('node:buffer')\n}\n\nlet _url: typeof import('node:url') | undefined\n/**\n * Lazily load the url module.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getUrl() {\n if (_url === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _url = /*@__PURE__*/ require('node:url')\n }\n return _url as typeof import('node:url')\n}\n\n/**\n * Check if a path contains node_modules directory.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isNodeModules(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n return nodeModulesPathRegExp.test(filepath)\n}\n\n/**\n * Check if a path is absolute.\n *\n * An absolute path is one that specifies a location from the root of the file system.\n * This function handles both POSIX and Windows path formats.\n *\n * POSIX absolute paths:\n * - Start with forward slash '/'\n * - Examples: '/home/user', '/usr/bin/node'\n *\n * Windows absolute paths (3 types):\n * 1. Drive-letter paths: Start with drive letter + colon + separator\n * - Format: [A-Za-z]:[\\\\/]\n * - Examples: 'C:\\Windows', 'D:/data', 'c:\\Program Files'\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#file-and-directory-names\n *\n * 2. UNC paths: Start with double backslash (handled by backslash check)\n * - Format: \\\\server\\share\n * - Examples: '\\\\server\\share\\file', '\\\\?\\C:\\path'\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#unc-names\n *\n * 3. Device paths: Start with backslash\n * - Examples: '\\Windows', '\\\\.\\device'\n * - Note: Single backslash paths are relative to current drive\n *\n * Examples:\n * - isAbsolute('/home/user') \u2192 true (POSIX)\n * - isAbsolute('C:\\\\Windows') \u2192 true (Windows drive letter)\n * - isAbsolute('\\\\server\\\\share') \u2192 true (Windows UNC)\n * - isAbsolute('../relative') \u2192 false\n * - isAbsolute('relative/path') \u2192 false\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isAbsolute(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n const { length } = filepath\n\n // Empty paths are not absolute.\n if (length === 0) {\n return false\n }\n\n const code = filepath.charCodeAt(0)\n\n // POSIX: absolute paths start with forward slash '/'.\n // This is the simplest case and works for all UNIX-like systems.\n if (code === CHAR_FORWARD_SLASH) {\n return true\n }\n\n // Windows: absolute paths can start with backslash '\\'.\n // This includes UNC paths (\\\\server\\share) and device paths (\\\\.\\ or \\\\?\\).\n // Single backslash is technically relative to current drive, but treated as absolute.\n if (code === CHAR_BACKWARD_SLASH) {\n return true\n }\n\n // Windows: drive-letter absolute paths (e.g., C:\\, D:\\).\n // Format: [A-Za-z]:[\\\\/]\n // Requires at least 3 characters: drive letter + colon + separator.\n // Only treat as absolute on Windows platforms.\n if (WIN32 && length > 2) {\n // Check if first character is a letter (A-Z or a-z).\n // Check if second character is colon ':'.\n // Check if third character is a path separator (forward or backslash).\n // This matches patterns like 'C:\\', 'D:/', 'c:\\Users', etc.\n if (\n isWindowsDeviceRoot(code) &&\n filepath.charCodeAt(1) === CHAR_COLON &&\n isPathSeparator(filepath.charCodeAt(2))\n ) {\n return true\n }\n }\n\n // Not an absolute path.\n return false\n}\n\n/**\n * Check if a value is a valid file path (absolute or relative).\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isPath(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n if (typeof filepath !== 'string' || filepath.length === 0) {\n return false\n }\n\n // Exclude URLs with protocols (file:, http:, https:, git:, etc.).\n // These should be handled by package spec parsers, not treated as file paths.\n // Require at least 2 characters before colon to exclude Windows drive letters (C:, D:).\n if (/^[a-z][a-z0-9+.-]+:/i.test(filepath)) {\n return false\n }\n\n // Special relative paths.\n if (filepath === '.' || filepath === '..') {\n return true\n }\n\n // Absolute paths are always valid paths.\n if (isAbsolute(filepath)) {\n return true\n }\n\n // Contains path separators, so it's a path.\n if (filepath.includes('/') || filepath.includes('\\\\')) {\n // Distinguish scoped package names from paths starting with '@'.\n // Scoped packages: @scope/name (exactly 2 parts, no backslashes).\n // Paths: @scope/name/subpath (3+ parts) or @scope\\name (Windows backslash).\n // Special case: '@/' is a valid path (already handled by separator check).\n if (filepath.startsWith('@') && !filepath.startsWith('@/')) {\n const parts = filepath.split('/')\n // If exactly @scope/name with no Windows separators, it's a package name.\n if (parts.length <= 2 && !parts[1]?.includes('\\\\')) {\n return false\n }\n }\n return true\n }\n\n // Bare names without separators are package names, not paths.\n return false\n}\n\n/**\n * Check if a path is relative.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isRelative(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n if (typeof filepath !== 'string') {\n return false\n }\n // Empty string is considered relative.\n if (filepath.length === 0) {\n return true\n }\n // A path is relative if it's not absolute.\n return !isAbsolute(filepath)\n}\n\n/**\n * Normalize a path by converting backslashes to forward slashes and collapsing segments.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function normalizePath(pathLike: string | Buffer | URL): string {\n const filepath = pathLikeToString(pathLike)\n const { length } = filepath\n if (length === 0) {\n return '.'\n }\n if (length < 2) {\n return length === 1 && filepath.charCodeAt(0) === 92 /*'\\\\'*/\n ? '/'\n : filepath\n }\n\n let code = 0\n let start = 0\n\n // Ensure win32 namespaces have two leading slashes so they are handled properly\n // by path.win32.parse() after being normalized.\n // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces\n // UNC paths, paths starting with double slashes, e.g. \"\\\\\\\\wsl.localhost\\\\Ubuntu\\home\\\\\",\n // are okay to convert to forward slashes.\n // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions\n let prefix = ''\n if (length > 4 && filepath.charCodeAt(3) === 92 /*'\\\\'*/) {\n const code2 = filepath.charCodeAt(2)\n // Look for \\\\?\\ or \\\\.\\\n if (\n (code2 === 63 /*'?'*/ || code2 === 46) /*'.'*/ &&\n filepath.charCodeAt(0) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(1) === 92 /*'\\\\'*/\n ) {\n start = 2\n prefix = '//'\n }\n }\n if (start === 0) {\n // Check for UNC paths first (\\\\server\\share or //server/share)\n // UNC paths must start with exactly two slashes, not more\n if (\n length > 2 &&\n ((filepath.charCodeAt(0) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(1) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(2) !== 92) /*'\\\\'*/ ||\n (filepath.charCodeAt(0) === 47 /*'/'*/ &&\n filepath.charCodeAt(1) === 47 /*'/'*/ &&\n filepath.charCodeAt(2) !== 47)) /*'/'*/\n ) {\n // Check if this is a valid UNC path: must have server/share format\n // Find the first segment (server name) and second segment (share name)\n let firstSegmentEnd = -1\n let hasSecondSegment = false\n\n // Skip leading slashes after the initial double slash\n let i = 2\n while (\n i < length &&\n (filepath.charCodeAt(i) === 47 /*'/'*/ ||\n filepath.charCodeAt(i) === 92) /*'\\\\'*/\n ) {\n i++\n }\n\n // Find the end of first segment (server name)\n while (i < length) {\n const char = filepath.charCodeAt(i)\n if (char === 47 /*'/'*/ || char === 92 /*'\\\\'*/) {\n firstSegmentEnd = i\n break\n }\n i++\n }\n\n if (firstSegmentEnd > 2) {\n // Skip slashes after server name\n i = firstSegmentEnd\n while (\n i < length &&\n (filepath.charCodeAt(i) === 47 /*'/'*/ ||\n filepath.charCodeAt(i) === 92) /*'\\\\'*/\n ) {\n i++\n }\n // Check if there's a share name (second segment)\n if (i < length) {\n hasSecondSegment = true\n }\n }\n\n if (firstSegmentEnd > 2 && hasSecondSegment) {\n // Valid UNC path - preserve double leading slashes\n start = 2\n prefix = '//'\n } else {\n // Just repeated slashes, treat as regular path\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n if (start) {\n prefix = '/'\n }\n }\n } else {\n // Trim leading slashes for regular paths\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n if (start) {\n prefix = '/'\n }\n }\n }\n let nextIndex = search(filepath, slashRegExp, { fromIndex: start })\n if (nextIndex === -1) {\n const segment = filepath.slice(start)\n if (segment === '.' || segment.length === 0) {\n return prefix || '.'\n }\n if (segment === '..') {\n return prefix ? prefix.slice(0, -1) || '/' : '..'\n }\n return prefix + segment\n }\n // Process segments and handle '.', '..', and empty segments.\n let collapsed = ''\n let segmentCount = 0\n let leadingDotDots = 0\n while (nextIndex !== -1) {\n const segment = filepath.slice(start, nextIndex)\n if (segment.length > 0 && segment !== '.') {\n if (segment === '..') {\n // Handle '..' by removing the last segment if possible.\n if (segmentCount > 0) {\n // Find the last separator and remove the last segment.\n const lastSeparatorIndex = collapsed.lastIndexOf('/')\n if (lastSeparatorIndex === -1) {\n // Only one segment, remove it entirely.\n collapsed = ''\n segmentCount = 0\n // Check if this was a leading '..', restore it.\n if (leadingDotDots > 0 && !prefix) {\n collapsed = '..'\n leadingDotDots = 1\n }\n } else {\n const lastSegmentStart = lastSeparatorIndex + 1\n const lastSegmentValue = collapsed.slice(lastSegmentStart)\n // Don't collapse leading '..' segments.\n if (lastSegmentValue === '..') {\n // Preserve the '..' and add another one.\n collapsed = `${collapsed}/${segment}`\n leadingDotDots += 1\n } else {\n // Normal collapse: remove the last segment.\n collapsed = collapsed.slice(0, lastSeparatorIndex)\n segmentCount -= 1\n }\n }\n } else if (!prefix) {\n // Preserve '..' for relative paths.\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + segment\n leadingDotDots += 1\n }\n } else {\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + segment\n segmentCount += 1\n }\n }\n start = nextIndex + 1\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n nextIndex = search(filepath, slashRegExp, { fromIndex: start })\n }\n const lastSegment = filepath.slice(start)\n if (lastSegment.length > 0 && lastSegment !== '.') {\n if (lastSegment === '..') {\n if (segmentCount > 0) {\n const lastSeparatorIndex = collapsed.lastIndexOf('/')\n if (lastSeparatorIndex === -1) {\n collapsed = ''\n segmentCount = 0\n // Check if this was a leading '..', restore it.\n if (leadingDotDots > 0 && !prefix) {\n collapsed = '..'\n leadingDotDots = 1\n }\n } else {\n const lastSegmentStart = lastSeparatorIndex + 1\n const lastSegmentValue = collapsed.slice(lastSegmentStart)\n // Don't collapse leading '..' segments.\n if (lastSegmentValue === '..') {\n // Preserve the '..' and add another one.\n collapsed = `${collapsed}/${lastSegment}`\n leadingDotDots += 1\n } else {\n // Normal collapse: remove the last segment.\n collapsed = collapsed.slice(0, lastSeparatorIndex)\n segmentCount -= 1\n }\n }\n } else if (!prefix) {\n collapsed =\n collapsed + (collapsed.length === 0 ? '' : '/') + lastSegment\n leadingDotDots += 1\n }\n } else {\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + lastSegment\n segmentCount += 1\n }\n }\n\n if (collapsed.length === 0) {\n return prefix || '.'\n }\n return prefix + collapsed\n}\n\n/**\n * Convert a path-like value to a string.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function pathLikeToString(\n pathLike: string | Buffer | URL | null | undefined,\n): string {\n if (pathLike === null || pathLike === undefined) {\n return ''\n }\n if (typeof pathLike === 'string') {\n return pathLike\n }\n const { Buffer } = getBuffer()\n if (Buffer.isBuffer(pathLike)) {\n return pathLike.toString('utf8')\n }\n const url = getUrl()\n if (pathLike instanceof URL) {\n try {\n return url.fileURLToPath(pathLike)\n } catch {\n // On Windows, file URLs like `file:///C:/path` include drive letters.\n // If a file URL is missing its drive letter (malformed), fileURLToPath() throws an error.\n // This fallback extracts the pathname directly from the URL object.\n //\n // Example flows:\n // - Unix: file:///home/user \u2192 pathname '/home/user' \u2192 keep as-is\n // - Windows valid: file:///C:/path \u2192 handled by fileURLToPath()\n // - Windows invalid: file:///path \u2192 pathname '/path' \u2192 strips to 'path'\n const pathname = pathLike.pathname\n\n // Decode percent-encoded characters (e.g., %20 \u2192 space).\n // The pathname property keeps URL encoding, but file paths need decoded characters.\n // This is not platform-specific; all URLs use percent-encoding regardless of OS.\n const decodedPathname = decodeURIComponent(pathname)\n\n // URL pathnames always start with `/`.\n // On Windows, strip the leading slash only for malformed URLs that lack drive letters\n // (e.g., `/path` should be `path`, but `/C:/path` should be `C:/path`).\n // On Unix, keep the leading slash for absolute paths (e.g., `/home/user`).\n const WIN32 = require('../constants/platform').WIN32\n if (WIN32 && decodedPathname.startsWith('/')) {\n // Check for drive letter pattern following Node.js source: /[a-zA-Z]:/\n // Character at index 1 should be a letter, character at index 2 should be ':'\n // Convert to lowercase\n const letter = decodedPathname.charCodeAt(1) | 0x20\n const hasValidDriveLetter =\n decodedPathname.length >= 3 &&\n letter >= 97 &&\n // 'a' to 'z'\n letter <= 122 &&\n decodedPathname.charAt(2) === ':'\n\n if (!hasValidDriveLetter) {\n // On Windows, preserve Unix-style absolute paths that don't start with a drive letter.\n // Only strip the leading slash for truly malformed Windows paths.\n // Since fileURLToPath() failed, this is likely a valid Unix-style absolute path.\n return decodedPathname\n }\n }\n return decodedPathname\n }\n }\n return String(pathLike)\n}\n\n/**\n * Split a path into an array of segments.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function splitPath(pathLike: string | Buffer | URL): string[] {\n const filepath = pathLikeToString(pathLike)\n if (filepath === '') {\n return []\n }\n return filepath.split(slashRegExp)\n}\n\n/**\n * Remove leading ./ or ../ from a path.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function trimLeadingDotSlash(pathLike: string | Buffer | URL): string {\n const filepath = pathLikeToString(pathLike)\n // Only trim ./ not ../\n if (filepath.startsWith('./') || filepath.startsWith('.\\\\')) {\n return filepath.slice(2)\n }\n return filepath\n}\n\n/**\n * Resolve an absolute path from path segments.\n *\n * This function mimics Node.js path.resolve() behavior by:\n * 1. Processing segments from right to left\n * 2. Stopping when an absolute path is found\n * 3. Prepending current working directory if no absolute path found\n * 4. Normalizing the final path\n *\n * Examples:\n * - resolve('foo', 'bar', 'baz') \u2192 '/cwd/foo/bar/baz'\n * - resolve('/foo', 'bar', 'baz') \u2192 '/foo/bar/baz'\n * - resolve('foo', '/bar', 'baz') \u2192 '/bar/baz'\n * - resolve('C:\\\\foo', 'bar') \u2192 'C:/foo/bar' (Windows)\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction resolve(...segments: string[]): string {\n let resolvedPath = ''\n let resolvedAbsolute = false\n\n // Process segments from right to left until we find an absolute path.\n // This allows later segments to override earlier ones.\n // Example: resolve('/foo', '/bar') returns '/bar', not '/foo/bar'.\n for (let i = segments.length - 1; i >= 0 && !resolvedAbsolute; i -= 1) {\n const segment = segments[i]\n\n // Skip empty or non-string segments.\n if (typeof segment !== 'string' || segment.length === 0) {\n continue\n }\n\n // Prepend the segment to the resolved path.\n // Use forward slashes as separators (normalized later).\n resolvedPath =\n segment + (resolvedPath.length === 0 ? '' : `/${resolvedPath}`)\n\n // Check if this segment is absolute.\n // Absolute paths stop the resolution process.\n resolvedAbsolute = isAbsolute(segment)\n }\n\n // If no absolute path was found in segments, prepend current working directory.\n // This ensures the final path is always absolute.\n if (!resolvedAbsolute) {\n const cwd = /*@__PURE__*/ require('node:process').cwd()\n resolvedPath = cwd + (resolvedPath.length === 0 ? '' : `/${resolvedPath}`)\n }\n\n // Normalize the resolved path (collapse '..' and '.', convert separators).\n return normalizePath(resolvedPath)\n}\n\n/**\n * Calculate the relative path from one path to another.\n *\n * This function computes how to get from `from` to `to` using relative path notation.\n * Both paths are first resolved to absolute paths, then compared to find the common\n * base path, and finally a relative path is constructed using '../' for parent\n * directory traversal.\n *\n * Algorithm:\n * 1. Resolve both paths to absolute\n * 2. Find the longest common path prefix (up to a separator)\n * 3. For each remaining directory in `from`, add '../' to go up\n * 4. Append the remaining path from `to`\n *\n * Windows-specific behavior:\n * - File system paths are case-insensitive on Windows (NTFS, FAT32)\n * - 'C:\\Foo' and 'c:\\foo' are considered the same path\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n * - Case is preserved but not significant for comparison\n *\n * Examples:\n * - relative('/foo/bar', '/foo/baz') \u2192 '../baz'\n * - relative('/foo/bar/baz', '/foo') \u2192 '../..'\n * - relative('/foo', '/foo/bar') \u2192 'bar'\n * - relative('C:\\\\foo\\\\bar', 'C:\\\\foo\\\\baz') \u2192 '../baz' (Windows)\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction relative(from: string, to: string): string {\n // Quick return if paths are already identical.\n if (from === to) {\n return ''\n }\n\n // Resolve both paths to absolute.\n // This handles relative paths, '.', '..', and ensures consistent format.\n const actualFrom = resolve(from)\n const actualTo = resolve(to)\n\n // Check again after resolution (paths might have been equivalent).\n if (actualFrom === actualTo) {\n return ''\n }\n\n const WIN32 = require('../constants/platform').WIN32\n\n // Windows: perform case-insensitive comparison.\n // NTFS and FAT32 preserve case but are case-insensitive for lookups.\n // This means 'C:\\Foo\\bar.txt' and 'c:\\foo\\BAR.TXT' refer to the same file.\n // Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#case-sensitivity\n if (WIN32) {\n const fromLower = actualFrom.toLowerCase()\n const toLower = actualTo.toLowerCase()\n if (fromLower === toLower) {\n return ''\n }\n }\n\n // Skip the leading separator for comparison.\n // We compare paths starting after the root separator to find common directories.\n // Example: '/foo/bar' becomes 'foo/bar' for comparison (index 1).\n const fromStart = 1\n const fromEnd = actualFrom.length\n const fromLen = fromEnd - fromStart\n const toStart = 1\n const toEnd = actualTo.length\n const toLen = toEnd - toStart\n\n // Compare paths character by character to find the longest common prefix.\n // We only consider a common prefix valid if it ends at a directory separator.\n const length = fromLen < toLen ? fromLen : toLen\n // Index of last common directory separator.\n let lastCommonSep = -1\n let i = 0\n\n for (; i < length; i += 1) {\n const fromCode = actualFrom.charCodeAt(fromStart + i)\n const toCode = actualTo.charCodeAt(toStart + i)\n\n // Paths diverge at this character.\n if (fromCode !== toCode) {\n break\n }\n\n // Track directory separators (both forward and backslash for Windows compatibility).\n // We need this to ensure we only split at directory boundaries.\n if (isPathSeparator(fromCode)) {\n lastCommonSep = i\n }\n }\n\n // Handle edge cases where one path is a prefix of the other.\n if (i === length) {\n if (toLen > length) {\n // Destination path is longer.\n const toCode = actualTo.charCodeAt(toStart + i)\n if (isPathSeparator(toCode)) {\n // `from` is the exact base path for `to`.\n // Example: from='/foo/bar'; to='/foo/bar/baz' \u2192 'baz'\n // Skip the separator character (+1) to get just the relative portion.\n return actualTo.slice(toStart + i + 1)\n }\n if (i === 0) {\n // `from` is the root directory.\n // Example: from='/'; to='/foo' \u2192 'foo'\n return actualTo.slice(toStart + i)\n }\n } else if (fromLen > length) {\n // Source path is longer.\n const fromCode = actualFrom.charCodeAt(fromStart + i)\n if (isPathSeparator(fromCode)) {\n // `to` is the exact base path for `from`.\n // Example: from='/foo/bar/baz'; to='/foo/bar' \u2192 '..'\n // We need to go up from the extra directory.\n lastCommonSep = i\n } else if (i === 0) {\n // `to` is the root directory.\n // Example: from='/foo'; to='/' \u2192 '..'\n lastCommonSep = 0\n }\n }\n }\n\n // Generate the relative path by constructing '../' segments.\n let out = ''\n\n // Count the number of directories in `from` after the common base.\n // For each directory, we need to go up one level ('../').\n // Example: from='/a/b/c', to='/a/x' \u2192 common='a', need '../..' (up from c, up from b)\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; i += 1) {\n const code = actualFrom.charCodeAt(i)\n\n // At the end of the path or at a separator, add '../'.\n if (i === fromEnd || isPathSeparator(code)) {\n out += out.length === 0 ? '..' : '/..'\n }\n }\n\n // Append the rest of the destination path after the common base.\n // This gives us the path from the common ancestor to the destination.\n return out + actualTo.slice(toStart + lastCommonSep)\n}\n\n/**\n * Get the relative path from one path to another.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function relativeResolve(from: string, to: string): string {\n const rel = relative(from, to)\n // Empty string means same path - don't normalize to '.'\n if (rel === '') {\n return ''\n }\n return normalizePath(rel)\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,sBAAsB;AAEtB,qBAAuB;AAIvB,MAAM,sBAAsB;AAE5B,MAAM,aAAa;AAEnB,MAAM,qBAAqB;AAE3B,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAEzB,MAAM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AAW,WAAW,YAAY,CAAC;AACpD,UAAI,gCAAgB,QAAQ,GAAG;AAI7B,wBAAgB;AAAA,MAClB,WAAW,MAAM,GAAG;AAGlB,wBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAGA,MAAI,MAAM;AAKV,OAAK,IAAI,YAAY,gBAAgB,GAAG,KAAK,SAAS,KAAK,GAAG;AAC5D,UAAM,OAAO,WAAW,WAAW,CAAC;AAGpC,QAAI,MAAM,WAAW,gCAAgB,IAAI,GAAG;AAC1C,aAAO,IAAI,WAAW,IAAI,OAAO;AAAA,IACnC;AAAA,EACF;AAIA,SAAO,MAAM,SAAS,MAAM,UAAU,aAAa;AACrD;AAAA;AAMO,SAAS,gBAAgB,MAAc,IAAoB;AAChE,QAAM,MAAM,yBAAS,MAAM,EAAE;AAE7B,MAAI,QAAQ,IAAI;AACd,WAAO;AAAA,EACT;AACA,SAAO,8BAAc,GAAG;AAC1B;",
4
+ "sourcesContent": ["/**\n * @fileoverview Path manipulation utilities with cross-platform support.\n * Provides path normalization, validation, and file extension handling.\n */\n\nimport { WIN32 } from '#constants/platform'\n\nimport { search } from './strings'\n\n// Character code constants.\n// '\\'\nconst CHAR_BACKWARD_SLASH = 92\n// ':'\nconst CHAR_COLON = 58\n// '/'\nconst CHAR_FORWARD_SLASH = 47\n// 'a'\nconst CHAR_LOWERCASE_A = 97\n// 'z'\nconst CHAR_LOWERCASE_Z = 122\n// 'A'\nconst CHAR_UPPERCASE_A = 65\n// 'Z'\nconst CHAR_UPPERCASE_Z = 90\n\n// Regular expressions.\nconst slashRegExp = /[/\\\\]/\nconst nodeModulesPathRegExp = /(?:^|[/\\\\])node_modules(?:[/\\\\]|$)/\n\n/**\n * Check if a character code represents a path separator.\n *\n * Determines whether the given character code is either a forward slash (/) or\n * backslash (\\), which are used as path separators across different platforms.\n *\n * @param {number} code - The character code to check\n * @returns {boolean} `true` if the code represents a path separator, `false` otherwise\n *\n * @example\n * ```typescript\n * isPathSeparator(47) // true - forward slash '/'\n * isPathSeparator(92) // true - backslash '\\'\n * isPathSeparator(65) // false - letter 'A'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction isPathSeparator(code: number): boolean {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH\n}\n\n/**\n * Check if a character code represents a Windows device root letter.\n *\n * Tests whether the given character code falls within the valid range for\n * Windows drive letters (A-Z or a-z). These letters are used at the start\n * of Windows absolute paths (e.g., `C:\\`, `D:\\`).\n *\n * @param {number} code - The character code to check\n * @returns {boolean} `true` if the code is a valid drive letter, `false` otherwise\n *\n * @example\n * ```typescript\n * isWindowsDeviceRoot(67) // true - letter 'C'\n * isWindowsDeviceRoot(99) // true - letter 'c'\n * isWindowsDeviceRoot(58) // false - colon ':'\n * isWindowsDeviceRoot(47) // false - forward slash '/'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction isWindowsDeviceRoot(code: number): boolean {\n return (\n (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||\n (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z)\n )\n}\n\nlet _buffer: typeof import('node:buffer') | undefined\n/**\n * Lazily load the buffer module.\n *\n * Performs on-demand loading of Node.js buffer module to avoid initialization\n * overhead and potential Webpack bundling errors.\n *\n * @private\n * @returns {typeof import('node:buffer')} The buffer module\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getBuffer() {\n if (_buffer === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _buffer = /*@__PURE__*/ require('node:buffer')\n }\n return _buffer as typeof import('node:buffer')\n}\n\nlet _url: typeof import('node:url') | undefined\n/**\n * Lazily load the url module.\n *\n * Performs on-demand loading of Node.js url module to avoid initialization\n * overhead and potential Webpack bundling errors.\n *\n * @private\n * @returns {typeof import('node:url')} The url module\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getUrl() {\n if (_url === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _url = /*@__PURE__*/ require('node:url')\n }\n return _url as typeof import('node:url')\n}\n\n/**\n * Check if a path contains node_modules directory.\n *\n * Detects whether a given path includes a `node_modules` directory segment.\n * This is useful for identifying npm package dependencies and filtering\n * dependency-related paths.\n *\n * The check matches `node_modules` appearing as a complete path segment,\n * ensuring it is either at the start, end, or surrounded by path separators.\n *\n * @param {string | Buffer | URL} pathLike - The path to check\n * @returns {boolean} `true` if the path contains `node_modules`, `false` otherwise\n *\n * @example\n * ```typescript\n * isNodeModules('/project/node_modules/package') // true\n * isNodeModules('node_modules/package/index.js') // true\n * isNodeModules('/src/my_node_modules_backup') // false\n * isNodeModules('/project/src/index.js') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isNodeModules(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n return nodeModulesPathRegExp.test(filepath)\n}\n\n/**\n * Check if a path is absolute.\n *\n * An absolute path is one that specifies a location from the root of the file system.\n * This function handles both POSIX and Windows path formats.\n *\n * POSIX absolute paths:\n * - Start with forward slash '/'\n * - Examples: '/home/user', '/usr/bin/node'\n *\n * Windows absolute paths (3 types):\n * 1. Drive-letter paths: Start with drive letter + colon + separator\n * - Format: [A-Za-z]:[\\\\/]\n * - Examples: 'C:\\Windows', 'D:/data', 'c:\\Program Files'\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#file-and-directory-names\n *\n * 2. UNC paths: Start with double backslash (handled by backslash check)\n * - Format: \\\\server\\share\n * - Examples: '\\\\server\\share\\file', '\\\\?\\C:\\path'\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#unc-names\n *\n * 3. Device paths: Start with backslash\n * - Examples: '\\Windows', '\\\\.\\device'\n * - Note: Single backslash paths are relative to current drive\n *\n * @param {string | Buffer | URL} pathLike - The path to check\n * @returns {boolean} `true` if the path is absolute, `false` otherwise\n *\n * @example\n * ```typescript\n * // POSIX paths\n * isAbsolute('/home/user') // true\n * isAbsolute('/usr/bin/node') // true\n *\n * // Windows paths\n * isAbsolute('C:\\\\Windows') // true\n * isAbsolute('D:/data') // true\n * isAbsolute('\\\\\\\\server\\\\share') // true\n *\n * // Relative paths\n * isAbsolute('../relative') // false\n * isAbsolute('relative/path') // false\n * isAbsolute('.') // false\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isAbsolute(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n const { length } = filepath\n\n // Empty paths are not absolute.\n if (length === 0) {\n return false\n }\n\n const code = filepath.charCodeAt(0)\n\n // POSIX: absolute paths start with forward slash '/'.\n // This is the simplest case and works for all UNIX-like systems.\n if (code === CHAR_FORWARD_SLASH) {\n return true\n }\n\n // Windows: absolute paths can start with backslash '\\'.\n // This includes UNC paths (\\\\server\\share) and device paths (\\\\.\\ or \\\\?\\).\n // Single backslash is technically relative to current drive, but treated as absolute.\n if (code === CHAR_BACKWARD_SLASH) {\n return true\n }\n\n // Windows: drive-letter absolute paths (e.g., C:\\, D:\\).\n // Format: [A-Za-z]:[\\\\/]\n // Requires at least 3 characters: drive letter + colon + separator.\n // Only treat as absolute on Windows platforms.\n if (WIN32 && length > 2) {\n // Check if first character is a letter (A-Z or a-z).\n // Check if second character is colon ':'.\n // Check if third character is a path separator (forward or backslash).\n // This matches patterns like 'C:\\', 'D:/', 'c:\\Users', etc.\n if (\n isWindowsDeviceRoot(code) &&\n filepath.charCodeAt(1) === CHAR_COLON &&\n isPathSeparator(filepath.charCodeAt(2))\n ) {\n return true\n }\n }\n\n // Not an absolute path.\n return false\n}\n\n/**\n * Check if a value is a valid file path (absolute or relative).\n *\n * Determines whether a given value represents a valid file system path.\n * This function distinguishes between file paths and other string formats\n * like package names, URLs, or bare module specifiers.\n *\n * Valid paths include:\n * - Absolute paths (e.g., `/usr/bin`, `C:\\Windows`)\n * - Relative paths with separators (e.g., `./src`, `../lib`)\n * - Special relative paths (`.`, `..`)\n * - Paths starting with `@` that have subpaths (e.g., `@scope/name/file`)\n *\n * Not considered paths:\n * - URLs with protocols (e.g., `http://`, `file://`, `git:`)\n * - Bare package names (e.g., `lodash`, `react`)\n * - Scoped package names without subpaths (e.g., `@scope/name`)\n *\n * @param {string | Buffer | URL} pathLike - The value to check\n * @returns {boolean} `true` if the value is a valid file path, `false` otherwise\n *\n * @example\n * ```typescript\n * // Valid paths\n * isPath('/absolute/path') // true\n * isPath('./relative/path') // true\n * isPath('../parent/dir') // true\n * isPath('.') // true\n * isPath('..') // true\n * isPath('@scope/name/subpath') // true\n * isPath('C:\\\\Windows') // true (Windows)\n *\n * // Not paths\n * isPath('lodash') // false - bare package name\n * isPath('@scope/package') // false - scoped package name\n * isPath('http://example.com') // false - URL\n * isPath('file://path') // false - file URL\n * isPath('') // false - empty string\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isPath(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n if (typeof filepath !== 'string' || filepath.length === 0) {\n return false\n }\n\n // Exclude URLs with protocols (file:, http:, https:, git:, etc.).\n // These should be handled by package spec parsers, not treated as file paths.\n // Require at least 2 characters before colon to exclude Windows drive letters (C:, D:).\n if (/^[a-z][a-z0-9+.-]+:/i.test(filepath)) {\n return false\n }\n\n // Special relative paths.\n if (filepath === '.' || filepath === '..') {\n return true\n }\n\n // Absolute paths are always valid paths.\n if (isAbsolute(filepath)) {\n return true\n }\n\n // Contains path separators, so it's a path.\n if (filepath.includes('/') || filepath.includes('\\\\')) {\n // Distinguish scoped package names from paths starting with '@'.\n // Scoped packages: @scope/name (exactly 2 parts, no backslashes).\n // Paths: @scope/name/subpath (3+ parts) or @scope\\name (Windows backslash).\n // Special case: '@/' is a valid path (already handled by separator check).\n if (filepath.startsWith('@') && !filepath.startsWith('@/')) {\n const parts = filepath.split('/')\n // If exactly @scope/name with no Windows separators, it's a package name.\n if (parts.length <= 2 && !parts[1]?.includes('\\\\')) {\n return false\n }\n }\n return true\n }\n\n // Bare names without separators are package names, not paths.\n return false\n}\n\n/**\n * Check if a path is relative.\n *\n * Determines whether a given path is relative (i.e., not absolute). A path\n * is considered relative if it does not specify a location from the root of\n * the file system.\n *\n * Relative paths include:\n * - Paths starting with `.` or `..` (e.g., `./src`, `../lib`)\n * - Paths without leading separators (e.g., `src/file.js`)\n * - Empty strings (treated as relative)\n *\n * @param {string | Buffer | URL} pathLike - The path to check\n * @returns {boolean} `true` if the path is relative, `false` if absolute\n *\n * @example\n * ```typescript\n * // Relative paths\n * isRelative('./src/index.js') // true\n * isRelative('../lib/util.js') // true\n * isRelative('src/file.js') // true\n * isRelative('') // true\n *\n * // Absolute paths\n * isRelative('/home/user') // false\n * isRelative('C:\\\\Windows') // false (Windows)\n * isRelative('\\\\\\\\server\\\\share') // false (Windows UNC)\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function isRelative(pathLike: string | Buffer | URL): boolean {\n const filepath = pathLikeToString(pathLike)\n if (typeof filepath !== 'string') {\n return false\n }\n // Empty string is considered relative.\n if (filepath.length === 0) {\n return true\n }\n // A path is relative if it's not absolute.\n return !isAbsolute(filepath)\n}\n\n/**\n * Normalize a path by converting backslashes to forward slashes and collapsing segments.\n *\n * This function performs several normalization operations:\n * - Converts all backslashes (`\\`) to forward slashes (`/`)\n * - Collapses repeated slashes into single slashes\n * - Resolves `.` (current directory) segments\n * - Resolves `..` (parent directory) segments\n * - Preserves UNC path prefixes (`//server/share`)\n * - Preserves Windows namespace prefixes (`//./`, `//?/`)\n * - Returns `.` for empty or collapsed paths\n *\n * Special handling:\n * - UNC paths: Maintains double leading slashes for `//server/share` format\n * - Windows namespaces: Preserves `//./` and `//?/` prefixes\n * - Leading `..` segments: Preserved in relative paths without prefix\n * - Trailing components: Properly handled when resolving `..`\n *\n * @param {string | Buffer | URL} pathLike - The path to normalize\n * @returns {string} The normalized path with forward slashes and collapsed segments\n *\n * @example\n * ```typescript\n * // Basic normalization\n * normalizePath('foo/bar//baz') // 'foo/bar/baz'\n * normalizePath('foo/./bar') // 'foo/bar'\n * normalizePath('foo/bar/../baz') // 'foo/baz'\n *\n * // Windows paths\n * normalizePath('C:\\\\Users\\\\John\\\\file.txt') // 'C:/Users/John/file.txt'\n * normalizePath('foo\\\\bar\\\\baz') // 'foo/bar/baz'\n *\n * // UNC paths\n * normalizePath('\\\\\\\\server\\\\share\\\\file') // '//server/share/file'\n *\n * // Edge cases\n * normalizePath('') // '.'\n * normalizePath('.') // '.'\n * normalizePath('..') // '..'\n * normalizePath('///foo///bar///') // '/foo/bar'\n * normalizePath('foo/../..') // '..'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function normalizePath(pathLike: string | Buffer | URL): string {\n const filepath = pathLikeToString(pathLike)\n const { length } = filepath\n if (length === 0) {\n return '.'\n }\n if (length < 2) {\n return length === 1 && filepath.charCodeAt(0) === 92 /*'\\\\'*/\n ? '/'\n : filepath\n }\n\n let code = 0\n let start = 0\n\n // Ensure win32 namespaces have two leading slashes so they are handled properly\n // by path.win32.parse() after being normalized.\n // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces\n // UNC paths, paths starting with double slashes, e.g. \"\\\\\\\\wsl.localhost\\\\Ubuntu\\home\\\\\",\n // are okay to convert to forward slashes.\n // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions\n let prefix = ''\n if (length > 4 && filepath.charCodeAt(3) === 92 /*'\\\\'*/) {\n const code2 = filepath.charCodeAt(2)\n // Look for \\\\?\\ or \\\\.\\\n if (\n (code2 === 63 /*'?'*/ || code2 === 46) /*'.'*/ &&\n filepath.charCodeAt(0) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(1) === 92 /*'\\\\'*/\n ) {\n start = 2\n prefix = '//'\n }\n }\n if (start === 0) {\n // Check for UNC paths first (\\\\server\\share or //server/share)\n // UNC paths must start with exactly two slashes, not more\n if (\n length > 2 &&\n ((filepath.charCodeAt(0) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(1) === 92 /*'\\\\'*/ &&\n filepath.charCodeAt(2) !== 92) /*'\\\\'*/ ||\n (filepath.charCodeAt(0) === 47 /*'/'*/ &&\n filepath.charCodeAt(1) === 47 /*'/'*/ &&\n filepath.charCodeAt(2) !== 47)) /*'/'*/\n ) {\n // Check if this is a valid UNC path: must have server/share format\n // Find the first segment (server name) and second segment (share name)\n let firstSegmentEnd = -1\n let hasSecondSegment = false\n\n // Skip leading slashes after the initial double slash\n let i = 2\n while (\n i < length &&\n (filepath.charCodeAt(i) === 47 /*'/'*/ ||\n filepath.charCodeAt(i) === 92) /*'\\\\'*/\n ) {\n i++\n }\n\n // Find the end of first segment (server name)\n while (i < length) {\n const char = filepath.charCodeAt(i)\n if (char === 47 /*'/'*/ || char === 92 /*'\\\\'*/) {\n firstSegmentEnd = i\n break\n }\n i++\n }\n\n if (firstSegmentEnd > 2) {\n // Skip slashes after server name\n i = firstSegmentEnd\n while (\n i < length &&\n (filepath.charCodeAt(i) === 47 /*'/'*/ ||\n filepath.charCodeAt(i) === 92) /*'\\\\'*/\n ) {\n i++\n }\n // Check if there's a share name (second segment)\n if (i < length) {\n hasSecondSegment = true\n }\n }\n\n if (firstSegmentEnd > 2 && hasSecondSegment) {\n // Valid UNC path - preserve double leading slashes\n start = 2\n prefix = '//'\n } else {\n // Just repeated slashes, treat as regular path\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n if (start) {\n prefix = '/'\n }\n }\n } else {\n // Trim leading slashes for regular paths\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n if (start) {\n prefix = '/'\n }\n }\n }\n let nextIndex = search(filepath, slashRegExp, { fromIndex: start })\n if (nextIndex === -1) {\n const segment = filepath.slice(start)\n if (segment === '.' || segment.length === 0) {\n return prefix || '.'\n }\n if (segment === '..') {\n return prefix ? prefix.slice(0, -1) || '/' : '..'\n }\n return prefix + segment\n }\n // Process segments and handle '.', '..', and empty segments.\n let collapsed = ''\n let segmentCount = 0\n let leadingDotDots = 0\n while (nextIndex !== -1) {\n const segment = filepath.slice(start, nextIndex)\n if (segment.length > 0 && segment !== '.') {\n if (segment === '..') {\n // Handle '..' by removing the last segment if possible.\n if (segmentCount > 0) {\n // Find the last separator and remove the last segment.\n const lastSeparatorIndex = collapsed.lastIndexOf('/')\n if (lastSeparatorIndex === -1) {\n // Only one segment, remove it entirely.\n collapsed = ''\n segmentCount = 0\n // Check if this was a leading '..', restore it.\n if (leadingDotDots > 0 && !prefix) {\n collapsed = '..'\n leadingDotDots = 1\n }\n } else {\n const lastSegmentStart = lastSeparatorIndex + 1\n const lastSegmentValue = collapsed.slice(lastSegmentStart)\n // Don't collapse leading '..' segments.\n if (lastSegmentValue === '..') {\n // Preserve the '..' and add another one.\n collapsed = `${collapsed}/${segment}`\n leadingDotDots += 1\n } else {\n // Normal collapse: remove the last segment.\n collapsed = collapsed.slice(0, lastSeparatorIndex)\n segmentCount -= 1\n }\n }\n } else if (!prefix) {\n // Preserve '..' for relative paths.\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + segment\n leadingDotDots += 1\n }\n } else {\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + segment\n segmentCount += 1\n }\n }\n start = nextIndex + 1\n code = filepath.charCodeAt(start)\n while (code === 47 /*'/'*/ || code === 92 /*'\\\\'*/) {\n start += 1\n code = filepath.charCodeAt(start)\n }\n nextIndex = search(filepath, slashRegExp, { fromIndex: start })\n }\n const lastSegment = filepath.slice(start)\n if (lastSegment.length > 0 && lastSegment !== '.') {\n if (lastSegment === '..') {\n if (segmentCount > 0) {\n const lastSeparatorIndex = collapsed.lastIndexOf('/')\n if (lastSeparatorIndex === -1) {\n collapsed = ''\n segmentCount = 0\n // Check if this was a leading '..', restore it.\n if (leadingDotDots > 0 && !prefix) {\n collapsed = '..'\n leadingDotDots = 1\n }\n } else {\n const lastSegmentStart = lastSeparatorIndex + 1\n const lastSegmentValue = collapsed.slice(lastSegmentStart)\n // Don't collapse leading '..' segments.\n if (lastSegmentValue === '..') {\n // Preserve the '..' and add another one.\n collapsed = `${collapsed}/${lastSegment}`\n leadingDotDots += 1\n } else {\n // Normal collapse: remove the last segment.\n collapsed = collapsed.slice(0, lastSeparatorIndex)\n segmentCount -= 1\n }\n }\n } else if (!prefix) {\n collapsed =\n collapsed + (collapsed.length === 0 ? '' : '/') + lastSegment\n leadingDotDots += 1\n }\n } else {\n collapsed = collapsed + (collapsed.length === 0 ? '' : '/') + lastSegment\n segmentCount += 1\n }\n }\n\n if (collapsed.length === 0) {\n return prefix || '.'\n }\n return prefix + collapsed\n}\n\n/**\n * Convert a path-like value to a string.\n *\n * Converts various path-like types (string, Buffer, URL) into a normalized\n * string representation. This function handles different input formats and\n * provides consistent string output for path operations.\n *\n * Supported input types:\n * - `string`: Returned as-is\n * - `Buffer`: Decoded as UTF-8 string\n * - `URL`: Converted using `fileURLToPath()`, with fallback for malformed URLs\n * - `null` / `undefined`: Returns empty string\n *\n * URL handling:\n * - Valid file URLs are converted via `url.fileURLToPath()`\n * - Malformed URLs fall back to pathname extraction with decoding\n * - Windows drive letters in URLs are handled specially\n * - Percent-encoded characters are decoded (e.g., `%20` becomes space)\n *\n * @param {string | Buffer | URL | null | undefined} pathLike - The path-like value to convert\n * @returns {string} The string representation of the path, or empty string for null/undefined\n *\n * @example\n * ```typescript\n * // String input\n * pathLikeToString('/home/user') // '/home/user'\n *\n * // Buffer input\n * pathLikeToString(Buffer.from('/tmp/file')) // '/tmp/file'\n *\n * // URL input\n * pathLikeToString(new URL('file:///home/user')) // '/home/user'\n * pathLikeToString(new URL('file:///C:/Windows')) // 'C:/Windows' (Windows)\n *\n * // Null/undefined input\n * pathLikeToString(null) // ''\n * pathLikeToString(undefined) // ''\n *\n * // Percent-encoded URLs\n * pathLikeToString(new URL('file:///path%20with%20spaces')) // '/path with spaces'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function pathLikeToString(\n pathLike: string | Buffer | URL | null | undefined,\n): string {\n if (pathLike === null || pathLike === undefined) {\n return ''\n }\n if (typeof pathLike === 'string') {\n return pathLike\n }\n const { Buffer } = getBuffer()\n if (Buffer.isBuffer(pathLike)) {\n return pathLike.toString('utf8')\n }\n const url = getUrl()\n if (pathLike instanceof URL) {\n try {\n return url.fileURLToPath(pathLike)\n } catch {\n // On Windows, file URLs like `file:///C:/path` include drive letters.\n // If a file URL is missing its drive letter (malformed), fileURLToPath() throws an error.\n // This fallback extracts the pathname directly from the URL object.\n //\n // Example flows:\n // - Unix: file:///home/user \u2192 pathname '/home/user' \u2192 keep as-is\n // - Windows valid: file:///C:/path \u2192 handled by fileURLToPath()\n // - Windows invalid: file:///path \u2192 pathname '/path' \u2192 strips to 'path'\n const pathname = pathLike.pathname\n\n // Decode percent-encoded characters (e.g., %20 \u2192 space).\n // The pathname property keeps URL encoding, but file paths need decoded characters.\n // This is not platform-specific; all URLs use percent-encoding regardless of OS.\n const decodedPathname = decodeURIComponent(pathname)\n\n // URL pathnames always start with `/`.\n // On Windows, strip the leading slash only for malformed URLs that lack drive letters\n // (e.g., `/path` should be `path`, but `/C:/path` should be `C:/path`).\n // On Unix, keep the leading slash for absolute paths (e.g., `/home/user`).\n const WIN32 = require('../constants/platform').WIN32\n if (WIN32 && decodedPathname.startsWith('/')) {\n // Check for drive letter pattern following Node.js source: /[a-zA-Z]:/\n // Character at index 1 should be a letter, character at index 2 should be ':'\n // Convert to lowercase\n const letter = decodedPathname.charCodeAt(1) | 0x20\n const hasValidDriveLetter =\n decodedPathname.length >= 3 &&\n letter >= 97 &&\n // 'a' to 'z'\n letter <= 122 &&\n decodedPathname.charAt(2) === ':'\n\n if (!hasValidDriveLetter) {\n // On Windows, preserve Unix-style absolute paths that don't start with a drive letter.\n // Only strip the leading slash for truly malformed Windows paths.\n // Since fileURLToPath() failed, this is likely a valid Unix-style absolute path.\n return decodedPathname\n }\n }\n return decodedPathname\n }\n }\n return String(pathLike)\n}\n\n/**\n * Split a path into an array of segments.\n *\n * Divides a path into individual components by splitting on path separators\n * (both forward slashes and backslashes). This is useful for path traversal,\n * analysis, and manipulation.\n *\n * The function handles:\n * - Forward slashes (`/`) on all platforms\n * - Backslashes (`\\`) on Windows\n * - Mixed separators in a single path\n * - Empty paths (returns empty array)\n *\n * Note: The resulting array may contain empty strings if the path has leading,\n * trailing, or consecutive separators (e.g., `/foo//bar/` becomes `['', 'foo', '', 'bar', '']`).\n *\n * @param {string | Buffer | URL} pathLike - The path to split\n * @returns {string[]} Array of path segments, or empty array for empty paths\n *\n * @example\n * ```typescript\n * // POSIX paths\n * splitPath('/home/user/file.txt') // ['', 'home', 'user', 'file.txt']\n * splitPath('src/lib/util.js') // ['src', 'lib', 'util.js']\n *\n * // Windows paths\n * splitPath('C:\\\\Users\\\\John') // ['C:', 'Users', 'John']\n * splitPath('folder\\\\file.txt') // ['folder', 'file.txt']\n *\n * // Mixed separators\n * splitPath('path/to\\\\file') // ['path', 'to', 'file']\n *\n * // Edge cases\n * splitPath('') // []\n * splitPath('/') // ['', '']\n * splitPath('/foo//bar/') // ['', 'foo', '', 'bar', '']\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function splitPath(pathLike: string | Buffer | URL): string[] {\n const filepath = pathLikeToString(pathLike)\n if (filepath === '') {\n return []\n }\n return filepath.split(slashRegExp)\n}\n\n/**\n * Remove leading ./ or ../ from a path.\n *\n * Strips the `./` or `.\\` prefix from relative paths. This is useful for\n * normalizing paths when the current directory reference is implicit or\n * unwanted.\n *\n * Note: This function only removes a single leading `./` or `.\\`. It does\n * not remove `../` prefixes or process the rest of the path.\n *\n * @param {string | Buffer | URL} pathLike - The path to process\n * @returns {string} The path without leading `./` or `.\\`, or unchanged if no such prefix\n *\n * @example\n * ```typescript\n * // Remove ./ prefix\n * trimLeadingDotSlash('./src/index.js') // 'src/index.js'\n * trimLeadingDotSlash('.\\\\src\\\\file.txt') // 'src\\\\file.txt'\n *\n * // Preserve ../ prefix\n * trimLeadingDotSlash('../lib/util.js') // '../lib/util.js'\n *\n * // No change for other paths\n * trimLeadingDotSlash('/absolute/path') // '/absolute/path'\n * trimLeadingDotSlash('relative/path') // 'relative/path'\n * trimLeadingDotSlash('.') // '.'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function trimLeadingDotSlash(pathLike: string | Buffer | URL): string {\n const filepath = pathLikeToString(pathLike)\n // Only trim ./ not ../\n if (filepath.startsWith('./') || filepath.startsWith('.\\\\')) {\n return filepath.slice(2)\n }\n return filepath\n}\n\n/**\n * Resolve an absolute path from path segments.\n *\n * This function mimics Node.js `path.resolve()` behavior by building an\n * absolute path from the given segments. It processes segments from right\n * to left, stopping when an absolute path is encountered. If no absolute\n * path is found, it prepends the current working directory.\n *\n * Algorithm:\n * 1. Process segments from right to left\n * 2. Stop when an absolute path is found\n * 3. Prepend current working directory if no absolute path found\n * 4. Normalize the final path\n *\n * Key behaviors:\n * - Later segments override earlier ones (e.g., `resolve('/foo', '/bar')` returns `/bar`)\n * - Empty or non-string segments are skipped\n * - Result is always an absolute path\n * - Path separators are normalized to forward slashes\n *\n * @param {...string} segments - Path segments to resolve\n * @returns {string} The resolved absolute path\n *\n * @example\n * ```typescript\n * // Basic resolution\n * resolve('foo', 'bar', 'baz') // '/cwd/foo/bar/baz' (assuming cwd is '/cwd')\n * resolve('/foo', 'bar', 'baz') // '/foo/bar/baz'\n * resolve('foo', '/bar', 'baz') // '/bar/baz'\n *\n * // Windows paths\n * resolve('C:\\\\foo', 'bar') // 'C:/foo/bar'\n *\n * // Empty segments\n * resolve('foo', '', 'bar') // '/cwd/foo/bar'\n * resolve() // '/cwd' (current directory)\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction resolve(...segments: string[]): string {\n let resolvedPath = ''\n let resolvedAbsolute = false\n\n // Process segments from right to left until we find an absolute path.\n // This allows later segments to override earlier ones.\n // Example: resolve('/foo', '/bar') returns '/bar', not '/foo/bar'.\n for (let i = segments.length - 1; i >= 0 && !resolvedAbsolute; i -= 1) {\n const segment = segments[i]\n\n // Skip empty or non-string segments.\n if (typeof segment !== 'string' || segment.length === 0) {\n continue\n }\n\n // Prepend the segment to the resolved path.\n // Use forward slashes as separators (normalized later).\n resolvedPath =\n segment + (resolvedPath.length === 0 ? '' : `/${resolvedPath}`)\n\n // Check if this segment is absolute.\n // Absolute paths stop the resolution process.\n resolvedAbsolute = isAbsolute(segment)\n }\n\n // If no absolute path was found in segments, prepend current working directory.\n // This ensures the final path is always absolute.\n if (!resolvedAbsolute) {\n const cwd = /*@__PURE__*/ require('node:process').cwd()\n resolvedPath = cwd + (resolvedPath.length === 0 ? '' : `/${resolvedPath}`)\n }\n\n // Normalize the resolved path (collapse '..' and '.', convert separators).\n return normalizePath(resolvedPath)\n}\n\n/**\n * Calculate the relative path from one path to another.\n *\n * This function computes how to get from the `from` path to the `to` path\n * using relative path notation. Both paths are first resolved to absolute\n * paths, then compared to find the common base path, and finally a relative\n * path is constructed using `../` for parent directory traversal.\n *\n * Algorithm:\n * 1. Resolve both paths to absolute\n * 2. Find the longest common path prefix (up to a separator)\n * 3. For each remaining directory in `from`, add `../` to go up\n * 4. Append the remaining path from `to`\n *\n * Windows-specific behavior:\n * - File system paths are case-insensitive on Windows (NTFS, FAT32)\n * - `C:\\Foo` and `c:\\foo` are considered the same path\n * - Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n * - Case is preserved but not significant for comparison\n *\n * @param {string} from - The source path (starting point)\n * @param {string} to - The destination path (target)\n * @returns {string} The relative path from `from` to `to`, or empty string if paths are identical\n *\n * @example\n * ```typescript\n * // Basic relative paths\n * relative('/foo/bar', '/foo/baz') // '../baz'\n * relative('/foo/bar/baz', '/foo') // '../..'\n * relative('/foo', '/foo/bar') // 'bar'\n *\n * // Same paths\n * relative('/foo/bar', '/foo/bar') // ''\n *\n * // Windows case-insensitive\n * relative('C:\\\\Foo\\\\bar', 'C:\\\\foo\\\\baz') // '../baz' (Windows)\n *\n * // Root paths\n * relative('/', '/foo/bar') // 'foo/bar'\n * relative('/foo/bar', '/') // '../..'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction relative(from: string, to: string): string {\n // Quick return if paths are already identical.\n if (from === to) {\n return ''\n }\n\n // Resolve both paths to absolute.\n // This handles relative paths, '.', '..', and ensures consistent format.\n const actualFrom = resolve(from)\n const actualTo = resolve(to)\n\n // Check again after resolution (paths might have been equivalent).\n if (actualFrom === actualTo) {\n return ''\n }\n\n const WIN32 = require('../constants/platform').WIN32\n\n // Windows: perform case-insensitive comparison.\n // NTFS and FAT32 preserve case but are case-insensitive for lookups.\n // This means 'C:\\Foo\\bar.txt' and 'c:\\foo\\BAR.TXT' refer to the same file.\n // Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#case-sensitivity\n if (WIN32) {\n const fromLower = actualFrom.toLowerCase()\n const toLower = actualTo.toLowerCase()\n if (fromLower === toLower) {\n return ''\n }\n }\n\n // Skip the leading separator for comparison.\n // We compare paths starting after the root separator to find common directories.\n // Example: '/foo/bar' becomes 'foo/bar' for comparison (index 1).\n const fromStart = 1\n const fromEnd = actualFrom.length\n const fromLen = fromEnd - fromStart\n const toStart = 1\n const toEnd = actualTo.length\n const toLen = toEnd - toStart\n\n // Compare paths character by character to find the longest common prefix.\n // We only consider a common prefix valid if it ends at a directory separator.\n const length = fromLen < toLen ? fromLen : toLen\n // Index of last common directory separator.\n let lastCommonSep = -1\n let i = 0\n\n for (; i < length; i += 1) {\n const fromCode = actualFrom.charCodeAt(fromStart + i)\n const toCode = actualTo.charCodeAt(toStart + i)\n\n // Paths diverge at this character.\n if (fromCode !== toCode) {\n break\n }\n\n // Track directory separators (both forward and backslash for Windows compatibility).\n // We need this to ensure we only split at directory boundaries.\n if (isPathSeparator(fromCode)) {\n lastCommonSep = i\n }\n }\n\n // Handle edge cases where one path is a prefix of the other.\n if (i === length) {\n if (toLen > length) {\n // Destination path is longer.\n const toCode = actualTo.charCodeAt(toStart + i)\n if (isPathSeparator(toCode)) {\n // `from` is the exact base path for `to`.\n // Example: from='/foo/bar'; to='/foo/bar/baz' \u2192 'baz'\n // Skip the separator character (+1) to get just the relative portion.\n return actualTo.slice(toStart + i + 1)\n }\n if (i === 0) {\n // `from` is the root directory.\n // Example: from='/'; to='/foo' \u2192 'foo'\n return actualTo.slice(toStart + i)\n }\n } else if (fromLen > length) {\n // Source path is longer.\n const fromCode = actualFrom.charCodeAt(fromStart + i)\n if (isPathSeparator(fromCode)) {\n // `to` is the exact base path for `from`.\n // Example: from='/foo/bar/baz'; to='/foo/bar' \u2192 '..'\n // We need to go up from the extra directory.\n lastCommonSep = i\n } else if (i === 0) {\n // `to` is the root directory.\n // Example: from='/foo'; to='/' \u2192 '..'\n lastCommonSep = 0\n }\n }\n }\n\n // Generate the relative path by constructing '../' segments.\n let out = ''\n\n // Count the number of directories in `from` after the common base.\n // For each directory, we need to go up one level ('../').\n // Example: from='/a/b/c', to='/a/x' \u2192 common='a', need '../..' (up from c, up from b)\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; i += 1) {\n const code = actualFrom.charCodeAt(i)\n\n // At the end of the path or at a separator, add '../'.\n if (i === fromEnd || isPathSeparator(code)) {\n out += out.length === 0 ? '..' : '/..'\n }\n }\n\n // Append the rest of the destination path after the common base.\n // This gives us the path from the common ancestor to the destination.\n return out + actualTo.slice(toStart + lastCommonSep)\n}\n\n/**\n * Get the relative path from one path to another.\n *\n * Computes the relative path from `from` to `to` and normalizes the result.\n * This is a convenience wrapper around the `relative()` function that adds\n * path normalization (converting separators and collapsing segments).\n *\n * The function:\n * 1. Calculates the relative path using `relative()`\n * 2. Normalizes the result using `normalizePath()`\n * 3. Preserves empty strings (same path) without converting to `.`\n *\n * @param {string} from - The source path (starting point)\n * @param {string} to - The destination path (target)\n * @returns {string} The normalized relative path from `from` to `to`, or empty string if paths are identical\n *\n * @example\n * ```typescript\n * // Basic usage\n * relativeResolve('/foo/bar', '/foo/baz') // '../baz'\n * relativeResolve('/foo/bar/baz', '/foo') // '../..'\n * relativeResolve('/foo', '/foo/bar') // 'bar'\n *\n * // Same paths\n * relativeResolve('/foo/bar', '/foo/bar') // ''\n *\n * // Windows paths (normalized)\n * relativeResolve('C:\\\\foo\\\\bar', 'C:\\\\foo\\\\baz') // '../baz'\n *\n * // With normalization\n * relativeResolve('/foo/./bar', '/foo/baz') // '../baz'\n * relativeResolve('/foo/bar/../baz', '/foo/qux') // '../qux'\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function relativeResolve(from: string, to: string): string {\n const rel = relative(from, to)\n // Empty string means same path - don't normalize to '.'\n if (rel === '') {\n return ''\n }\n return normalizePath(rel)\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,sBAAsB;AAEtB,qBAAuB;AAIvB,MAAM,sBAAsB;AAE5B,MAAM,aAAa;AAEnB,MAAM,qBAAqB;AAE3B,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAGzB,MAAM,cAAc;AACpB,MAAM,wBAAwB;AAAA;AAmB9B,SAAS,gBAAgB,MAAuB;AAC9C,SAAO,SAAS,sBAAsB,SAAS;AACjD;AAAA;AAqBA,SAAS,oBAAoB,MAAuB;AAClD,SACG,QAAQ,oBAAoB,QAAQ,oBACpC,QAAQ,oBAAoB,QAAQ;AAEzC;AAEA,IAAI;AAAA;AAWJ,SAAS,YAAY;AACnB,MAAI,YAAY,QAAW;AAGzB,cAAwB,QAAQ,aAAa;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,IAAI;AAAA;AAWJ,SAAS,SAAS;AAChB,MAAI,SAAS,QAAW;AAGtB,WAAqB,QAAQ,UAAU;AAAA,EACzC;AACA,SAAO;AAC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