@logtape/file 1.4.0-dev.443 → 1.4.0-dev.445

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 (73) hide show
  1. package/dist/filesink.base.d.cts +1 -1
  2. package/dist/filesink.base.d.ts +1 -1
  3. package/dist/filesink.deno.cjs +46 -1
  4. package/dist/filesink.deno.d.cts +31 -1
  5. package/dist/filesink.deno.d.cts.map +1 -1
  6. package/dist/filesink.deno.d.ts +31 -1
  7. package/dist/filesink.deno.d.ts.map +1 -1
  8. package/dist/filesink.deno.js +43 -1
  9. package/dist/filesink.deno.js.map +1 -1
  10. package/dist/filesink.node.cjs +38 -1
  11. package/dist/filesink.node.d.cts +31 -1
  12. package/dist/filesink.node.d.cts.map +1 -1
  13. package/dist/filesink.node.d.ts +31 -1
  14. package/dist/filesink.node.d.ts.map +1 -1
  15. package/dist/filesink.node.js +35 -1
  16. package/dist/filesink.node.js.map +1 -1
  17. package/dist/mod.cjs +7 -1
  18. package/dist/mod.d.cts +3 -2
  19. package/dist/mod.d.ts +3 -2
  20. package/dist/mod.js +2 -2
  21. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/assert_path.cjs +8 -0
  22. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/assert_path.js +8 -0
  23. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/assert_path.js.map +1 -0
  24. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.cjs +20 -0
  25. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.js +13 -0
  26. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.js.map +1 -0
  27. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.cjs +10 -0
  28. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.js +10 -0
  29. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.js.map +1 -0
  30. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.cjs +10 -0
  31. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.js +11 -0
  32. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.js.map +1 -0
  33. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.cjs +56 -0
  34. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.js +57 -0
  35. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.js.map +1 -0
  36. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_os.cjs +6 -0
  37. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_os.js +6 -0
  38. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/_os.js.map +1 -0
  39. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/join.cjs +31 -0
  40. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/join.js +32 -0
  41. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/join.js.map +1 -0
  42. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.cjs +9 -0
  43. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.js +10 -0
  44. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.js.map +1 -0
  45. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.cjs +23 -0
  46. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.js +24 -0
  47. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.js.map +1 -0
  48. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/join.cjs +44 -0
  49. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/join.js +45 -0
  50. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/join.js.map +1 -0
  51. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.cjs +54 -0
  52. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.js +55 -0
  53. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.js.map +1 -0
  54. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/_util.cjs +13 -0
  55. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/_util.js +13 -0
  56. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/_util.js.map +1 -0
  57. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/from_file_url.cjs +27 -0
  58. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/from_file_url.js +28 -0
  59. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/from_file_url.js.map +1 -0
  60. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/join.cjs +51 -0
  61. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/join.js +52 -0
  62. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/join.js.map +1 -0
  63. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/normalize.cjs +82 -0
  64. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/normalize.js +83 -0
  65. package/dist/node_modules/.pnpm/@jsr_std__path@1.1.0/node_modules/@jsr/std__path/windows/normalize.js.map +1 -0
  66. package/dist/timefilesink.cjs +208 -0
  67. package/dist/timefilesink.d.cts +104 -0
  68. package/dist/timefilesink.d.cts.map +1 -0
  69. package/dist/timefilesink.d.ts +104 -0
  70. package/dist/timefilesink.d.ts.map +1 -0
  71. package/dist/timefilesink.js +208 -0
  72. package/dist/timefilesink.js.map +1 -0
  73. package/package.json +2 -2
@@ -0,0 +1,20 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.js
3
+ const CHAR_UPPERCASE_A = 65;
4
+ const CHAR_LOWERCASE_A = 97;
5
+ const CHAR_UPPERCASE_Z = 90;
6
+ const CHAR_LOWERCASE_Z = 122;
7
+ const CHAR_DOT = 46;
8
+ const CHAR_FORWARD_SLASH = 47;
9
+ const CHAR_BACKWARD_SLASH = 92;
10
+ const CHAR_COLON = 58;
11
+
12
+ //#endregion
13
+ exports.CHAR_BACKWARD_SLASH = CHAR_BACKWARD_SLASH;
14
+ exports.CHAR_COLON = CHAR_COLON;
15
+ exports.CHAR_DOT = CHAR_DOT;
16
+ exports.CHAR_FORWARD_SLASH = CHAR_FORWARD_SLASH;
17
+ exports.CHAR_LOWERCASE_A = CHAR_LOWERCASE_A;
18
+ exports.CHAR_LOWERCASE_Z = CHAR_LOWERCASE_Z;
19
+ exports.CHAR_UPPERCASE_A = CHAR_UPPERCASE_A;
20
+ exports.CHAR_UPPERCASE_Z = CHAR_UPPERCASE_Z;
@@ -0,0 +1,13 @@
1
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.js
2
+ const CHAR_UPPERCASE_A = 65;
3
+ const CHAR_LOWERCASE_A = 97;
4
+ const CHAR_UPPERCASE_Z = 90;
5
+ const CHAR_LOWERCASE_Z = 122;
6
+ const CHAR_DOT = 46;
7
+ const CHAR_FORWARD_SLASH = 47;
8
+ const CHAR_BACKWARD_SLASH = 92;
9
+ const CHAR_COLON = 58;
10
+
11
+ //#endregion
12
+ export { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, CHAR_UPPERCASE_A, CHAR_UPPERCASE_Z };
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/constants.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\n// Alphabet chars.\nexport const CHAR_UPPERCASE_A = 65; /* A */ \nexport const CHAR_LOWERCASE_A = 97; /* a */ \nexport const CHAR_UPPERCASE_Z = 90; /* Z */ \nexport const CHAR_LOWERCASE_Z = 122; /* z */ \n// Non-alphabetic chars.\nexport const CHAR_DOT = 46; /* . */ \nexport const CHAR_FORWARD_SLASH = 47; /* / */ \nexport const CHAR_BACKWARD_SLASH = 92; /* \\ */ \nexport const CHAR_VERTICAL_LINE = 124; /* | */ \nexport const CHAR_COLON = 58; /* : */ \nexport const CHAR_QUESTION_MARK = 63; /* ? */ \nexport const CHAR_UNDERSCORE = 95; /* _ */ \nexport const CHAR_LINE_FEED = 10; /* \\n */ \nexport const CHAR_CARRIAGE_RETURN = 13; /* \\r */ \nexport const CHAR_TAB = 9; /* \\t */ \nexport const CHAR_FORM_FEED = 12; /* \\f */ \nexport const CHAR_EXCLAMATION_MARK = 33; /* ! */ \nexport const CHAR_HASH = 35; /* # */ \nexport const CHAR_SPACE = 32; /* */ \nexport const CHAR_NO_BREAK_SPACE = 160; /* \\u00A0 */ \nexport const CHAR_ZERO_WIDTH_NOBREAK_SPACE = 65279; /* \\uFEFF */ \nexport const CHAR_LEFT_SQUARE_BRACKET = 91; /* [ */ \nexport const CHAR_RIGHT_SQUARE_BRACKET = 93; /* ] */ \nexport const CHAR_LEFT_ANGLE_BRACKET = 60; /* < */ \nexport const CHAR_RIGHT_ANGLE_BRACKET = 62; /* > */ \nexport const CHAR_LEFT_CURLY_BRACKET = 123; /* { */ \nexport const CHAR_RIGHT_CURLY_BRACKET = 125; /* } */ \nexport const CHAR_HYPHEN_MINUS = 45; /* - */ \nexport const CHAR_PLUS = 43; /* + */ \nexport const CHAR_DOUBLE_QUOTE = 34; /* \" */ \nexport const CHAR_SINGLE_QUOTE = 39; /* ' */ \nexport const CHAR_PERCENT = 37; /* % */ \nexport const CHAR_SEMICOLON = 59; /* ; */ \nexport const CHAR_CIRCUMFLEX_ACCENT = 94; /* ^ */ \nexport const CHAR_GRAVE_ACCENT = 96; /* ` */ \nexport const CHAR_AT = 64; /* @ */ \nexport const CHAR_AMPERSAND = 38; /* & */ \nexport const CHAR_EQUAL = 61; /* = */ \n// Digits\nexport const CHAR_0 = 48; /* 0 */ \nexport const CHAR_9 = 57; /* 9 */ \n//# sourceMappingURL=constants.js.map"],"x_google_ignoreList":[0],"mappings":";AAKA,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAEhC,MAAa,WAAW;AACxB,MAAa,qBAAqB;AAClC,MAAa,sBAAsB;AAEnC,MAAa,aAAa"}
@@ -0,0 +1,10 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.js
3
+ function assertArg(url) {
4
+ url = url instanceof URL ? url : new URL(url);
5
+ if (url.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
6
+ return url;
7
+ }
8
+
9
+ //#endregion
10
+ exports.assertArg = assertArg;
@@ -0,0 +1,10 @@
1
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.js
2
+ function assertArg(url) {
3
+ url = url instanceof URL ? url : new URL(url);
4
+ if (url.protocol !== "file:") throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
5
+ return url;
6
+ }
7
+
8
+ //#endregion
9
+ export { assertArg };
10
+ //# sourceMappingURL=from_file_url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from_file_url.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/from_file_url.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nexport function assertArg(url) {\n url = url instanceof URL ? url : new URL(url);\n if (url.protocol !== \"file:\") {\n throw new TypeError(`URL must be a file URL: received \"${url.protocol}\"`);\n }\n return url;\n}\n//# sourceMappingURL=from_file_url.js.map"],"x_google_ignoreList":[0],"mappings":";AAEA,SAAgB,UAAU,KAAK;AAC7B,OAAM,eAAe,MAAM,MAAM,IAAI,IAAI;AACzC,KAAI,IAAI,aAAa,QACnB,OAAM,IAAI,WAAW,oCAAoC,IAAI,SAAS;AAExE,QAAO;AACR"}
@@ -0,0 +1,10 @@
1
+ const require_assert_path = require('./assert_path.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.js
4
+ function assertArg(path) {
5
+ require_assert_path.assertPath(path);
6
+ if (path.length === 0) return ".";
7
+ }
8
+
9
+ //#endregion
10
+ exports.assertArg = assertArg;
@@ -0,0 +1,11 @@
1
+ import { assertPath } from "./assert_path.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.js
4
+ function assertArg(path) {
5
+ assertPath(path);
6
+ if (path.length === 0) return ".";
7
+ }
8
+
9
+ //#endregion
10
+ export { assertArg };
11
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"./assert_path.js\";\nexport function assertArg(path) {\n assertPath(path);\n if (path.length === 0) return \".\";\n}\n//# sourceMappingURL=normalize.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAgB,UAAU,MAAM;AAC9B,YAAW,KAAK;AAChB,KAAI,KAAK,WAAW,EAAG,QAAO;AAC/B"}
@@ -0,0 +1,56 @@
1
+ const require_constants = require('./constants.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.js
4
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
5
+ let res = "";
6
+ let lastSegmentLength = 0;
7
+ let lastSlash = -1;
8
+ let dots = 0;
9
+ let code;
10
+ for (let i = 0; i <= path.length; ++i) {
11
+ if (i < path.length) code = path.charCodeAt(i);
12
+ else if (isPathSeparator(code)) break;
13
+ else code = require_constants.CHAR_FORWARD_SLASH;
14
+ if (isPathSeparator(code)) {
15
+ if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) {
16
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== require_constants.CHAR_DOT || res.charCodeAt(res.length - 2) !== require_constants.CHAR_DOT) {
17
+ if (res.length > 2) {
18
+ const lastSlashIndex = res.lastIndexOf(separator);
19
+ if (lastSlashIndex === -1) {
20
+ res = "";
21
+ lastSegmentLength = 0;
22
+ } else {
23
+ res = res.slice(0, lastSlashIndex);
24
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
25
+ }
26
+ lastSlash = i;
27
+ dots = 0;
28
+ continue;
29
+ } else if (res.length === 2 || res.length === 1) {
30
+ res = "";
31
+ lastSegmentLength = 0;
32
+ lastSlash = i;
33
+ dots = 0;
34
+ continue;
35
+ }
36
+ }
37
+ if (allowAboveRoot) {
38
+ if (res.length > 0) res += `${separator}..`;
39
+ else res = "..";
40
+ lastSegmentLength = 2;
41
+ }
42
+ } else {
43
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
44
+ else res = path.slice(lastSlash + 1, i);
45
+ lastSegmentLength = i - lastSlash - 1;
46
+ }
47
+ lastSlash = i;
48
+ dots = 0;
49
+ } else if (code === require_constants.CHAR_DOT && dots !== -1) ++dots;
50
+ else dots = -1;
51
+ }
52
+ return res;
53
+ }
54
+
55
+ //#endregion
56
+ exports.normalizeString = normalizeString;
@@ -0,0 +1,57 @@
1
+ import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./constants.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.js
4
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
5
+ let res = "";
6
+ let lastSegmentLength = 0;
7
+ let lastSlash = -1;
8
+ let dots = 0;
9
+ let code;
10
+ for (let i = 0; i <= path.length; ++i) {
11
+ if (i < path.length) code = path.charCodeAt(i);
12
+ else if (isPathSeparator(code)) break;
13
+ else code = CHAR_FORWARD_SLASH;
14
+ if (isPathSeparator(code)) {
15
+ if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) {
16
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
17
+ if (res.length > 2) {
18
+ const lastSlashIndex = res.lastIndexOf(separator);
19
+ if (lastSlashIndex === -1) {
20
+ res = "";
21
+ lastSegmentLength = 0;
22
+ } else {
23
+ res = res.slice(0, lastSlashIndex);
24
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
25
+ }
26
+ lastSlash = i;
27
+ dots = 0;
28
+ continue;
29
+ } else if (res.length === 2 || res.length === 1) {
30
+ res = "";
31
+ lastSegmentLength = 0;
32
+ lastSlash = i;
33
+ dots = 0;
34
+ continue;
35
+ }
36
+ }
37
+ if (allowAboveRoot) {
38
+ if (res.length > 0) res += `${separator}..`;
39
+ else res = "..";
40
+ lastSegmentLength = 2;
41
+ }
42
+ } else {
43
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
44
+ else res = path.slice(lastSlash + 1, i);
45
+ lastSegmentLength = i - lastSlash - 1;
46
+ }
47
+ lastSlash = i;
48
+ dots = 0;
49
+ } else if (code === CHAR_DOT && dots !== -1) ++dots;
50
+ else dots = -1;
51
+ }
52
+ return res;
53
+ }
54
+
55
+ //#endregion
56
+ export { normalizeString };
57
+ //# sourceMappingURL=normalize_string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize_string.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_common/normalize_string.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\nimport { CHAR_DOT, CHAR_FORWARD_SLASH } from \"./constants.js\";\n// Resolves . and .. elements in a path with directory names\nexport function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for(let i = 0; i <= path.length; ++i){\n if (i < path.length) code = path.charCodeAt(i);\n else if (isPathSeparator(code)) break;\n else code = CHAR_FORWARD_SLASH;\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n } else if (res.length === 2 || res.length === 1) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) res += `${separator}..`;\n else res = \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);\n else res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n//# sourceMappingURL=normalize_string.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAMA,SAAgB,gBAAgB,MAAM,gBAAgB,WAAW,iBAAiB;CAChF,IAAI,MAAM;CACV,IAAI,oBAAoB;CACxB,IAAI,YAAY;CAChB,IAAI,OAAO;CACX,IAAI;AACJ,MAAI,IAAI,IAAI,GAAG,KAAK,KAAK,QAAQ,EAAE,GAAE;AACnC,MAAI,IAAI,KAAK,OAAQ,QAAO,KAAK,WAAW,EAAE;WACrC,gBAAgB,KAAK,CAAE;MAC3B,QAAO;AACZ,MAAI,gBAAgB,KAAK,EAAE;AACzB,OAAI,cAAc,IAAI,KAAK,SAAS,GAAG,CAEtC,WAAU,cAAc,IAAI,KAAK,SAAS,GAAG;AAC5C,QAAI,IAAI,SAAS,KAAK,sBAAsB,KAAK,IAAI,WAAW,IAAI,SAAS,EAAE,KAAK,YAAY,IAAI,WAAW,IAAI,SAAS,EAAE,KAAK,UACjI;SAAI,IAAI,SAAS,GAAG;MAClB,MAAM,iBAAiB,IAAI,YAAY,UAAU;AACjD,UAAI,mBAAmB,IAAI;AACzB,aAAM;AACN,2BAAoB;MACrB,OAAM;AACL,aAAM,IAAI,MAAM,GAAG,eAAe;AAClC,2BAAoB,IAAI,SAAS,IAAI,IAAI,YAAY,UAAU;MAChE;AACD,kBAAY;AACZ,aAAO;AACP;KACD,WAAU,IAAI,WAAW,KAAK,IAAI,WAAW,GAAG;AAC/C,YAAM;AACN,0BAAoB;AACpB,kBAAY;AACZ,aAAO;AACP;KACD;;AAEH,QAAI,gBAAgB;AAClB,SAAI,IAAI,SAAS,EAAG,SAAQ,EAAE,UAAU;SACnC,OAAM;AACX,yBAAoB;IACrB;GACF,OAAM;AACL,QAAI,IAAI,SAAS,EAAG,QAAO,YAAY,KAAK,MAAM,YAAY,GAAG,EAAE;QAC9D,OAAM,KAAK,MAAM,YAAY,GAAG,EAAE;AACvC,wBAAoB,IAAI,YAAY;GACrC;AACD,eAAY;AACZ,UAAO;EACR,WAAU,SAAS,YAAY,SAAS,GACvC,GAAE;MAEF,QAAO;CAEV;AACD,QAAO;AACR"}
@@ -0,0 +1,6 @@
1
+
2
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_os.js
3
+ const isWindows = globalThis.Deno?.build.os === "windows" || globalThis.navigator?.platform?.startsWith("Win") || globalThis.process?.platform?.startsWith("win") || false;
4
+
5
+ //#endregion
6
+ exports.isWindows = isWindows;
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_os.js
2
+ const isWindows = globalThis.Deno?.build.os === "windows" || globalThis.navigator?.platform?.startsWith("Win") || globalThis.process?.platform?.startsWith("win") || false;
3
+
4
+ //#endregion
5
+ export { isWindows };
6
+ //# sourceMappingURL=_os.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_os.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/_os.js"],"sourcesContent":["// deno-lint-ignore-file no-explicit-any\n// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\n// Check Deno, then the remaining runtimes (e.g. Node, Bun and the browser)\nexport const isWindows = globalThis.Deno?.build.os === \"windows\" || globalThis.navigator?.platform?.startsWith(\"Win\") || globalThis.process?.platform?.startsWith(\"win\") || false;\n//# sourceMappingURL=_os.js.map"],"x_google_ignoreList":[0],"mappings":";AAIA,MAAa,YAAY,WAAW,MAAM,MAAM,OAAO,aAAa,WAAW,WAAW,UAAU,WAAW,MAAM,IAAI,WAAW,SAAS,UAAU,WAAW,MAAM,IAAI"}
@@ -0,0 +1,31 @@
1
+ const require__os = require('./_os.cjs');
2
+ const require_join = require('./posix/join.cjs');
3
+ const require_join$1 = require('./windows/join.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/join.js
6
+ /**
7
+ * Joins a sequence of paths, then normalizes the resulting path.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { join } from "@std/path/join";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * if (Deno.build.os === "windows") {
15
+ * assertEquals(join("C:\\foo", "bar", "baz\\quux", "garply", ".."), "C:\\foo\\bar\\baz\\quux");
16
+ * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz/asdf", "quux", ".."), "C:\\foo\\bar\\baz\\asdf");
17
+ * } else {
18
+ * assertEquals(join("/foo", "bar", "baz/quux", "garply", ".."), "/foo/bar/baz/quux");
19
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
20
+ * }
21
+ * ```
22
+ *
23
+ * @param path The path to join. This can be string or file URL.
24
+ * @param paths Paths to be joined and normalized.
25
+ * @returns The joined and normalized path.
26
+ */ function join$2(path, ...paths) {
27
+ return require__os.isWindows ? require_join$1.join(path, ...paths) : require_join.join(path, ...paths);
28
+ }
29
+
30
+ //#endregion
31
+ exports.join = join$2;
@@ -0,0 +1,32 @@
1
+ import { isWindows } from "./_os.js";
2
+ import { join } from "./posix/join.js";
3
+ import { join as join$1 } from "./windows/join.js";
4
+
5
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/join.js
6
+ /**
7
+ * Joins a sequence of paths, then normalizes the resulting path.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { join } from "@std/path/join";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * if (Deno.build.os === "windows") {
15
+ * assertEquals(join("C:\\foo", "bar", "baz\\quux", "garply", ".."), "C:\\foo\\bar\\baz\\quux");
16
+ * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz/asdf", "quux", ".."), "C:\\foo\\bar\\baz\\asdf");
17
+ * } else {
18
+ * assertEquals(join("/foo", "bar", "baz/quux", "garply", ".."), "/foo/bar/baz/quux");
19
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
20
+ * }
21
+ * ```
22
+ *
23
+ * @param path The path to join. This can be string or file URL.
24
+ * @param paths Paths to be joined and normalized.
25
+ * @returns The joined and normalized path.
26
+ */ function join$2(path, ...paths) {
27
+ return isWindows ? join$1(path, ...paths) : join(path, ...paths);
28
+ }
29
+
30
+ //#endregion
31
+ export { join$2 as join };
32
+ //# sourceMappingURL=join.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join.js","names":["join"],"sources":["../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/join.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { isWindows } from \"./_os.js\";\nimport { join as posixJoin } from \"./posix/join.js\";\nimport { join as windowsJoin } from \"./windows/join.js\";\n/**\n * Joins a sequence of paths, then normalizes the resulting path.\n *\n * @example Usage\n * ```ts\n * import { join } from \"@std/path/join\";\n * import { assertEquals } from \"@std/assert\";\n *\n * if (Deno.build.os === \"windows\") {\n * assertEquals(join(\"C:\\\\foo\", \"bar\", \"baz\\\\quux\", \"garply\", \"..\"), \"C:\\\\foo\\\\bar\\\\baz\\\\quux\");\n * assertEquals(join(new URL(\"file:///C:/foo\"), \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"C:\\\\foo\\\\bar\\\\baz\\\\asdf\");\n * } else {\n * assertEquals(join(\"/foo\", \"bar\", \"baz/quux\", \"garply\", \"..\"), \"/foo/bar/baz/quux\");\n * assertEquals(join(new URL(\"file:///foo\"), \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"/foo/bar/baz/asdf\");\n * }\n * ```\n *\n * @param path The path to join. This can be string or file URL.\n * @param paths Paths to be joined and normalized.\n * @returns The joined and normalized path.\n */ export function join(path, ...paths) {\n return isWindows ? windowsJoin(path, ...paths) : posixJoin(path, ...paths);\n}\n//# sourceMappingURL=join.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;GAyBI,SAAgBA,OAAK,MAAM,GAAG,OAAO;AACvC,QAAO,YAAY,OAAY,MAAM,GAAG,MAAM,GAAG,KAAU,MAAM,GAAG,MAAM;AAC3E"}
@@ -0,0 +1,9 @@
1
+ const require_constants = require('../_common/constants.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.js
4
+ function isPosixPathSeparator(code) {
5
+ return code === require_constants.CHAR_FORWARD_SLASH;
6
+ }
7
+
8
+ //#endregion
9
+ exports.isPosixPathSeparator = isPosixPathSeparator;
@@ -0,0 +1,10 @@
1
+ import { CHAR_FORWARD_SLASH } from "../_common/constants.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.js
4
+ function isPosixPathSeparator(code) {
5
+ return code === CHAR_FORWARD_SLASH;
6
+ }
7
+
8
+ //#endregion
9
+ export { isPosixPathSeparator };
10
+ //# sourceMappingURL=_util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_util.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/_util.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// Copyright the Browserify authors. MIT License.\n// Ported from https://github.com/browserify/path-browserify/\n// This module is browser compatible.\nimport { CHAR_FORWARD_SLASH } from \"../_common/constants.js\";\nexport function isPosixPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH;\n}\n//# sourceMappingURL=_util.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAKA,SAAgB,qBAAqB,MAAM;AACzC,QAAO,SAAS;AACjB"}
@@ -0,0 +1,23 @@
1
+ const require_from_file_url = require('../_common/from_file_url.cjs');
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.js
4
+ /**
5
+ * Converts a file URL to a path string.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { fromFileUrl } from "@std/path/posix/from-file-url";
10
+ * import { assertEquals } from "@std/assert";
11
+ *
12
+ * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
13
+ * ```
14
+ *
15
+ * @param url The file URL to convert.
16
+ * @returns The path string.
17
+ */ function fromFileUrl(url) {
18
+ url = require_from_file_url.assertArg(url);
19
+ return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
20
+ }
21
+
22
+ //#endregion
23
+ exports.fromFileUrl = fromFileUrl;
@@ -0,0 +1,24 @@
1
+ import { assertArg } from "../_common/from_file_url.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.js
4
+ /**
5
+ * Converts a file URL to a path string.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { fromFileUrl } from "@std/path/posix/from-file-url";
10
+ * import { assertEquals } from "@std/assert";
11
+ *
12
+ * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
13
+ * ```
14
+ *
15
+ * @param url The file URL to convert.
16
+ * @returns The path string.
17
+ */ function fromFileUrl(url) {
18
+ url = assertArg(url);
19
+ return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
20
+ }
21
+
22
+ //#endregion
23
+ export { fromFileUrl };
24
+ //# sourceMappingURL=from_file_url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from_file_url.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/from_file_url.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArg } from \"../_common/from_file_url.js\";\n/**\n * Converts a file URL to a path string.\n *\n * @example Usage\n * ```ts\n * import { fromFileUrl } from \"@std/path/posix/from-file-url\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(fromFileUrl(new URL(\"file:///home/foo\")), \"/home/foo\");\n * ```\n *\n * @param url The file URL to convert.\n * @returns The path string.\n */ export function fromFileUrl(url) {\n url = assertArg(url);\n return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, \"%25\"));\n}\n//# sourceMappingURL=from_file_url.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;GAgBI,SAAgB,YAAY,KAAK;AACnC,OAAM,UAAU,IAAI;AACpB,QAAO,mBAAmB,IAAI,SAAS,QAAQ,wBAAwB,MAAM,CAAC;AAC/E"}
@@ -0,0 +1,44 @@
1
+ const require_assert_path = require('../_common/assert_path.cjs');
2
+ const require_from_file_url = require('./from_file_url.cjs');
3
+ const require_normalize = require('./normalize.cjs');
4
+
5
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/join.js
6
+ /**
7
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { join } from "@std/path/posix/join";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
15
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
16
+ * ```
17
+ *
18
+ * @example Working with URLs
19
+ * ```ts
20
+ * import { join } from "@std/path/posix/join";
21
+ * import { assertEquals } from "@std/assert";
22
+ *
23
+ * const url = new URL("https://deno.land");
24
+ * url.pathname = join("std", "path", "mod.ts");
25
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
26
+ *
27
+ * url.pathname = join("//std", "path/", "/mod.ts");
28
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
29
+ * ```
30
+ *
31
+ * @param path The path to join. This can be string or file URL.
32
+ * @param paths The paths to join.
33
+ * @returns The joined path.
34
+ */ function join(path, ...paths) {
35
+ if (path === void 0) return ".";
36
+ if (path instanceof URL) path = require_from_file_url.fromFileUrl(path);
37
+ paths = path ? [path, ...paths] : paths;
38
+ paths.forEach((path$1) => require_assert_path.assertPath(path$1));
39
+ const joined = paths.filter((path$1) => path$1.length > 0).join("/");
40
+ return joined === "" ? "." : require_normalize.normalize(joined);
41
+ }
42
+
43
+ //#endregion
44
+ exports.join = join;
@@ -0,0 +1,45 @@
1
+ import { assertPath } from "../_common/assert_path.js";
2
+ import { fromFileUrl } from "./from_file_url.js";
3
+ import { normalize } from "./normalize.js";
4
+
5
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/join.js
6
+ /**
7
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { join } from "@std/path/posix/join";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
15
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
16
+ * ```
17
+ *
18
+ * @example Working with URLs
19
+ * ```ts
20
+ * import { join } from "@std/path/posix/join";
21
+ * import { assertEquals } from "@std/assert";
22
+ *
23
+ * const url = new URL("https://deno.land");
24
+ * url.pathname = join("std", "path", "mod.ts");
25
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
26
+ *
27
+ * url.pathname = join("//std", "path/", "/mod.ts");
28
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
29
+ * ```
30
+ *
31
+ * @param path The path to join. This can be string or file URL.
32
+ * @param paths The paths to join.
33
+ * @returns The joined path.
34
+ */ function join(path, ...paths) {
35
+ if (path === void 0) return ".";
36
+ if (path instanceof URL) path = fromFileUrl(path);
37
+ paths = path ? [path, ...paths] : paths;
38
+ paths.forEach((path$1) => assertPath(path$1));
39
+ const joined = paths.filter((path$1) => path$1.length > 0).join("/");
40
+ return joined === "" ? "." : normalize(joined);
41
+ }
42
+
43
+ //#endregion
44
+ export { join };
45
+ //# sourceMappingURL=join.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join.js","names":["path"],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/join.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertPath } from \"../_common/assert_path.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\nimport { normalize } from \"./normalize.js\";\n/**\n * Join all given a sequence of `paths`,then normalizes the resulting path.\n *\n * @example Usage\n * ```ts\n * import { join } from \"@std/path/posix/join\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(join(\"/foo\", \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"/foo/bar/baz/asdf\");\n * assertEquals(join(new URL(\"file:///foo\"), \"bar\", \"baz/asdf\", \"quux\", \"..\"), \"/foo/bar/baz/asdf\");\n * ```\n *\n * @example Working with URLs\n * ```ts\n * import { join } from \"@std/path/posix/join\";\n * import { assertEquals } from \"@std/assert\";\n *\n * const url = new URL(\"https://deno.land\");\n * url.pathname = join(\"std\", \"path\", \"mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/path/mod.ts\");\n *\n * url.pathname = join(\"//std\", \"path/\", \"/mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/path/mod.ts\");\n * ```\n *\n * @param path The path to join. This can be string or file URL.\n * @param paths The paths to join.\n * @returns The joined path.\n */ export function join(path, ...paths) {\n if (path === undefined) return \".\";\n if (path instanceof URL) {\n path = fromFileUrl(path);\n }\n paths = path ? [\n path,\n ...paths\n ] : paths;\n paths.forEach((path)=>assertPath(path));\n const joined = paths.filter((path)=>path.length > 0).join(\"/\");\n return joined === \"\" ? \".\" : normalize(joined);\n}\n//# sourceMappingURL=join.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCI,SAAgB,KAAK,MAAM,GAAG,OAAO;AACvC,KAAI,gBAAoB,QAAO;AAC/B,KAAI,gBAAgB,IAClB,QAAO,YAAY,KAAK;AAE1B,SAAQ,OAAO,CACb,MACA,GAAG,KACJ,IAAG;AACJ,OAAM,QAAQ,CAACA,WAAO,WAAWA,OAAK,CAAC;CACvC,MAAM,SAAS,MAAM,OAAO,CAACA,WAAOA,OAAK,SAAS,EAAE,CAAC,KAAK,IAAI;AAC9D,QAAO,WAAW,KAAK,MAAM,UAAU,OAAO;AAC/C"}
@@ -0,0 +1,54 @@
1
+ const require_from_file_url = require('./from_file_url.cjs');
2
+ const require_normalize = require('../_common/normalize.cjs');
3
+ const require_normalize_string = require('../_common/normalize_string.cjs');
4
+ const require__util = require('./_util.cjs');
5
+
6
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.js
7
+ /**
8
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
9
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
10
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
11
+ *
12
+ * @example Usage
13
+ * ```ts
14
+ * import { normalize } from "@std/path/posix/normalize";
15
+ * import { assertEquals } from "@std/assert";
16
+ *
17
+ * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
18
+ * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
19
+ * ```
20
+ *
21
+ * @example Working with URLs
22
+ *
23
+ * Note: This function will remove the double slashes from a URL's scheme.
24
+ * Hence, do not pass a full URL to this function. Instead, pass the pathname of
25
+ * the URL.
26
+ *
27
+ * ```ts
28
+ * import { normalize } from "@std/path/posix/normalize";
29
+ * import { assertEquals } from "@std/assert";
30
+ *
31
+ * const url = new URL("https://deno.land");
32
+ * url.pathname = normalize("//std//assert//.//mod.ts");
33
+ * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
34
+ *
35
+ * url.pathname = normalize("std/assert/../async/retry.ts");
36
+ * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
37
+ * ```
38
+ *
39
+ * @param path The path to normalize.
40
+ * @returns The normalized path.
41
+ */ function normalize(path) {
42
+ if (path instanceof URL) path = require_from_file_url.fromFileUrl(path);
43
+ require_normalize.assertArg(path);
44
+ const isAbsolute = require__util.isPosixPathSeparator(path.charCodeAt(0));
45
+ const trailingSeparator = require__util.isPosixPathSeparator(path.charCodeAt(path.length - 1));
46
+ path = require_normalize_string.normalizeString(path, !isAbsolute, "/", require__util.isPosixPathSeparator);
47
+ if (path.length === 0 && !isAbsolute) path = ".";
48
+ if (path.length > 0 && trailingSeparator) path += "/";
49
+ if (isAbsolute) return `/${path}`;
50
+ return path;
51
+ }
52
+
53
+ //#endregion
54
+ exports.normalize = normalize;
@@ -0,0 +1,55 @@
1
+ import { fromFileUrl } from "./from_file_url.js";
2
+ import { assertArg } from "../_common/normalize.js";
3
+ import { normalizeString } from "../_common/normalize_string.js";
4
+ import { isPosixPathSeparator } from "./_util.js";
5
+
6
+ //#region ../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.js
7
+ /**
8
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
9
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
10
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
11
+ *
12
+ * @example Usage
13
+ * ```ts
14
+ * import { normalize } from "@std/path/posix/normalize";
15
+ * import { assertEquals } from "@std/assert";
16
+ *
17
+ * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
18
+ * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
19
+ * ```
20
+ *
21
+ * @example Working with URLs
22
+ *
23
+ * Note: This function will remove the double slashes from a URL's scheme.
24
+ * Hence, do not pass a full URL to this function. Instead, pass the pathname of
25
+ * the URL.
26
+ *
27
+ * ```ts
28
+ * import { normalize } from "@std/path/posix/normalize";
29
+ * import { assertEquals } from "@std/assert";
30
+ *
31
+ * const url = new URL("https://deno.land");
32
+ * url.pathname = normalize("//std//assert//.//mod.ts");
33
+ * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
34
+ *
35
+ * url.pathname = normalize("std/assert/../async/retry.ts");
36
+ * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
37
+ * ```
38
+ *
39
+ * @param path The path to normalize.
40
+ * @returns The normalized path.
41
+ */ function normalize(path) {
42
+ if (path instanceof URL) path = fromFileUrl(path);
43
+ assertArg(path);
44
+ const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
45
+ const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
46
+ path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
47
+ if (path.length === 0 && !isAbsolute) path = ".";
48
+ if (path.length > 0 && trailingSeparator) path += "/";
49
+ if (isAbsolute) return `/${path}`;
50
+ return path;
51
+ }
52
+
53
+ //#endregion
54
+ export { normalize };
55
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@jsr+std__path@1.1.0/node_modules/@jsr/std__path/posix/normalize.js"],"sourcesContent":["// Copyright 2018-2025 the Deno authors. MIT license.\n// This module is browser compatible.\nimport { assertArg } from \"../_common/normalize.js\";\nimport { normalizeString } from \"../_common/normalize_string.js\";\nimport { isPosixPathSeparator } from \"./_util.js\";\nimport { fromFileUrl } from \"./from_file_url.js\";\n/**\n * Normalize the `path`, resolving `'..'` and `'.'` segments.\n * Note that resolving these segments does not necessarily mean that all will be eliminated.\n * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.\n *\n * @example Usage\n * ```ts\n * import { normalize } from \"@std/path/posix/normalize\";\n * import { assertEquals } from \"@std/assert\";\n *\n * assertEquals(normalize(\"/foo/bar//baz/asdf/quux/..\"), \"/foo/bar/baz/asdf\");\n * assertEquals(normalize(new URL(\"file:///foo/bar//baz/asdf/quux/..\")), \"/foo/bar/baz/asdf/\");\n * ```\n *\n * @example Working with URLs\n *\n * Note: This function will remove the double slashes from a URL's scheme.\n * Hence, do not pass a full URL to this function. Instead, pass the pathname of\n * the URL.\n *\n * ```ts\n * import { normalize } from \"@std/path/posix/normalize\";\n * import { assertEquals } from \"@std/assert\";\n *\n * const url = new URL(\"https://deno.land\");\n * url.pathname = normalize(\"//std//assert//.//mod.ts\");\n * assertEquals(url.href, \"https://deno.land/std/assert/mod.ts\");\n *\n * url.pathname = normalize(\"std/assert/../async/retry.ts\");\n * assertEquals(url.href, \"https://deno.land/std/async/retry.ts\");\n * ```\n *\n * @param path The path to normalize.\n * @returns The normalized path.\n */ export function normalize(path) {\n if (path instanceof URL) {\n path = fromFileUrl(path);\n }\n assertArg(path);\n const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));\n const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));\n // Normalize the path\n path = normalizeString(path, !isAbsolute, \"/\", isPosixPathSeparator);\n if (path.length === 0 && !isAbsolute) path = \".\";\n if (path.length > 0 && trailingSeparator) path += \"/\";\n if (isAbsolute) return `/${path}`;\n return path;\n}\n//# sourceMappingURL=normalize.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCI,SAAgB,UAAU,MAAM;AAClC,KAAI,gBAAgB,IAClB,QAAO,YAAY,KAAK;AAE1B,WAAU,KAAK;CACf,MAAM,aAAa,qBAAqB,KAAK,WAAW,EAAE,CAAC;CAC3D,MAAM,oBAAoB,qBAAqB,KAAK,WAAW,KAAK,SAAS,EAAE,CAAC;AAEhF,QAAO,gBAAgB,OAAO,YAAY,KAAK,qBAAqB;AACpE,KAAI,KAAK,WAAW,MAAM,WAAY,QAAO;AAC7C,KAAI,KAAK,SAAS,KAAK,kBAAmB,SAAQ;AAClD,KAAI,WAAY,SAAQ,GAAG,KAAK;AAChC,QAAO;AACR"}