ventojs 0.7.1 → 0.7.2

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 (145) hide show
  1. package/esm/_dnt.shims.js +0 -1
  2. package/esm/deps/deno.land/std@0.201.0/assert/assert.d.ts +2 -0
  3. package/esm/deps/deno.land/std@0.201.0/assert/assert.js +8 -0
  4. package/esm/deps/deno.land/std@0.201.0/assert/assertion_error.d.ts +4 -0
  5. package/esm/deps/deno.land/std@0.201.0/assert/assertion_error.js +7 -0
  6. package/esm/deps/deno.land/std@0.201.0/path/_basename.d.ts +16 -0
  7. package/esm/deps/deno.land/std@0.201.0/path/_basename.js +78 -0
  8. package/esm/deps/deno.land/std@0.201.0/path/_dirname.d.ts +10 -0
  9. package/esm/deps/deno.land/std@0.201.0/path/_dirname.js +132 -0
  10. package/esm/deps/deno.land/std@0.201.0/path/_extname.d.ts +12 -0
  11. package/esm/deps/deno.land/std@0.201.0/path/_extname.js +121 -0
  12. package/esm/deps/deno.land/std@0.201.0/path/_format.d.ts +11 -0
  13. package/esm/deps/deno.land/std@0.201.0/path/_format.js +35 -0
  14. package/esm/deps/deno.land/std@0.201.0/path/_from_file_url.d.ts +25 -0
  15. package/esm/deps/deno.land/std@0.201.0/path/_from_file_url.js +46 -0
  16. package/esm/deps/deno.land/std@0.201.0/path/_is_absolute.d.ts +10 -0
  17. package/esm/deps/deno.land/std@0.201.0/path/_is_absolute.js +34 -0
  18. package/esm/deps/deno.land/std@0.201.0/path/_join.d.ts +10 -0
  19. package/esm/deps/deno.land/std@0.201.0/path/_join.js +93 -0
  20. package/esm/deps/deno.land/std@0.201.0/path/_normalize.d.ts +14 -0
  21. package/esm/deps/deno.land/std@0.201.0/path/_normalize.js +153 -0
  22. package/esm/deps/deno.land/std@0.201.0/path/_parse.d.ts +11 -0
  23. package/esm/deps/deno.land/std@0.201.0/path/_parse.js +250 -0
  24. package/esm/deps/deno.land/std@0.201.0/path/_relative.d.ts +19 -0
  25. package/esm/deps/deno.land/std@0.201.0/path/_relative.js +216 -0
  26. package/esm/deps/deno.land/std@0.201.0/path/_resolve.d.ts +10 -0
  27. package/esm/deps/deno.land/std@0.201.0/path/_resolve.js +183 -0
  28. package/esm/deps/deno.land/std@0.201.0/path/_to_file_url.d.ts +25 -0
  29. package/esm/deps/deno.land/std@0.201.0/path/_to_file_url.js +61 -0
  30. package/esm/deps/deno.land/std@0.201.0/path/_to_namespaced_path.d.ts +10 -0
  31. package/esm/deps/deno.land/std@0.201.0/path/_to_namespaced_path.js +46 -0
  32. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_util.d.ts +0 -5
  33. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_util.js +0 -54
  34. package/esm/deps/deno.land/std@0.201.0/path/basename.d.ts +8 -0
  35. package/esm/deps/deno.land/std@0.201.0/path/basename.js +16 -0
  36. package/esm/deps/deno.land/std@0.201.0/path/dirname.d.ts +5 -0
  37. package/esm/deps/deno.land/std@0.201.0/path/dirname.js +11 -0
  38. package/esm/deps/deno.land/std@0.201.0/path/extname.d.ts +6 -0
  39. package/esm/deps/deno.land/std@0.201.0/path/extname.js +12 -0
  40. package/esm/deps/deno.land/std@0.201.0/path/format.d.ts +6 -0
  41. package/esm/deps/deno.land/std@0.201.0/path/format.js +11 -0
  42. package/esm/deps/deno.land/std@0.201.0/path/from_file_url.d.ts +18 -0
  43. package/esm/deps/deno.land/std@0.201.0/path/from_file_url.js +23 -0
  44. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/glob.d.ts +1 -1
  45. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/glob.js +50 -50
  46. package/esm/deps/deno.land/std@0.201.0/path/is_absolute.d.ts +5 -0
  47. package/esm/deps/deno.land/std@0.201.0/path/is_absolute.js +11 -0
  48. package/esm/deps/deno.land/std@0.201.0/path/join.d.ts +5 -0
  49. package/esm/deps/deno.land/std@0.201.0/path/join.js +11 -0
  50. package/esm/deps/deno.land/std@0.201.0/path/mod.d.ts +22 -0
  51. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/mod.js +17 -4
  52. package/esm/deps/deno.land/std@0.201.0/path/normalize.d.ts +7 -0
  53. package/esm/deps/deno.land/std@0.201.0/path/normalize.js +13 -0
  54. package/esm/deps/deno.land/std@0.201.0/path/parse.d.ts +6 -0
  55. package/esm/deps/deno.land/std@0.201.0/path/parse.js +11 -0
  56. package/esm/deps/deno.land/std@0.201.0/path/posix.d.ts +15 -0
  57. package/esm/deps/deno.land/std@0.201.0/path/posix.js +19 -0
  58. package/esm/deps/deno.land/std@0.201.0/path/relative.d.ts +12 -0
  59. package/esm/deps/deno.land/std@0.201.0/path/relative.js +18 -0
  60. package/esm/deps/deno.land/std@0.201.0/path/resolve.d.ts +5 -0
  61. package/esm/deps/deno.land/std@0.201.0/path/resolve.js +13 -0
  62. package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/separator.js +1 -1
  63. package/esm/deps/deno.land/std@0.201.0/path/to_file_url.d.ts +18 -0
  64. package/esm/deps/deno.land/std@0.201.0/path/to_file_url.js +23 -0
  65. package/esm/deps/deno.land/std@0.201.0/path/to_namespaced_path.d.ts +5 -0
  66. package/esm/deps/deno.land/std@0.201.0/path/to_namespaced_path.js +13 -0
  67. package/esm/deps/deno.land/std@0.201.0/path/win32.d.ts +15 -0
  68. package/esm/deps/deno.land/std@0.201.0/path/win32.js +19 -0
  69. package/esm/deps.d.ts +1 -1
  70. package/esm/deps.js +1 -1
  71. package/esm/src/environment.js +3 -1
  72. package/package.json +1 -1
  73. package/esm/_dnt.test_polyfills.d.ts +0 -11
  74. package/esm/_dnt.test_shims.d.ts +0 -5
  75. package/esm/deps/deno.land/std@0.178.0/_util/asserts.d.ts +0 -10
  76. package/esm/deps/deno.land/std@0.178.0/_util/asserts.js +0 -21
  77. package/esm/deps/deno.land/std@0.178.0/path/mod.d.ts +0 -9
  78. package/esm/deps/deno.land/std@0.178.0/path/posix.d.ts +0 -86
  79. package/esm/deps/deno.land/std@0.178.0/path/posix.js +0 -442
  80. package/esm/deps/deno.land/std@0.178.0/path/win32.d.ts +0 -91
  81. package/esm/deps/deno.land/std@0.178.0/path/win32.js +0 -909
  82. package/esm/deps/deno.land/std@0.190.0/_util/asserts.d.ts +0 -10
  83. package/esm/deps/deno.land/std@0.190.0/bytes/copy.d.ts +0 -27
  84. package/esm/deps/deno.land/std@0.190.0/fmt/colors.d.ts +0 -270
  85. package/esm/deps/deno.land/std@0.190.0/front_matter/mod.d.ts +0 -78
  86. package/esm/deps/deno.land/std@0.190.0/front_matter/yaml.d.ts +0 -4
  87. package/esm/deps/deno.land/std@0.190.0/io/buffer.d.ts +0 -81
  88. package/esm/deps/deno.land/std@0.190.0/testing/_diff.d.ts +0 -26
  89. package/esm/deps/deno.land/std@0.190.0/testing/_format.d.ts +0 -1
  90. package/esm/deps/deno.land/std@0.190.0/testing/asserts.d.ts +0 -284
  91. package/esm/deps/deno.land/std@0.190.0/yaml/_error.d.ts +0 -6
  92. package/esm/deps/deno.land/std@0.190.0/yaml/_loader/loader.d.ts +0 -4
  93. package/esm/deps/deno.land/std@0.190.0/yaml/_loader/loader_state.d.ts +0 -43
  94. package/esm/deps/deno.land/std@0.190.0/yaml/_mark.d.ts +0 -10
  95. package/esm/deps/deno.land/std@0.190.0/yaml/_state.d.ts +0 -5
  96. package/esm/deps/deno.land/std@0.190.0/yaml/_type/binary.d.ts +0 -2
  97. package/esm/deps/deno.land/std@0.190.0/yaml/_type/bool.d.ts +0 -2
  98. package/esm/deps/deno.land/std@0.190.0/yaml/_type/float.d.ts +0 -2
  99. package/esm/deps/deno.land/std@0.190.0/yaml/_type/function.d.ts +0 -2
  100. package/esm/deps/deno.land/std@0.190.0/yaml/_type/int.d.ts +0 -2
  101. package/esm/deps/deno.land/std@0.190.0/yaml/_type/map.d.ts +0 -2
  102. package/esm/deps/deno.land/std@0.190.0/yaml/_type/merge.d.ts +0 -2
  103. package/esm/deps/deno.land/std@0.190.0/yaml/_type/mod.d.ts +0 -16
  104. package/esm/deps/deno.land/std@0.190.0/yaml/_type/nil.d.ts +0 -2
  105. package/esm/deps/deno.land/std@0.190.0/yaml/_type/omap.d.ts +0 -2
  106. package/esm/deps/deno.land/std@0.190.0/yaml/_type/pairs.d.ts +0 -2
  107. package/esm/deps/deno.land/std@0.190.0/yaml/_type/regexp.d.ts +0 -2
  108. package/esm/deps/deno.land/std@0.190.0/yaml/_type/seq.d.ts +0 -2
  109. package/esm/deps/deno.land/std@0.190.0/yaml/_type/set.d.ts +0 -2
  110. package/esm/deps/deno.land/std@0.190.0/yaml/_type/str.d.ts +0 -2
  111. package/esm/deps/deno.land/std@0.190.0/yaml/_type/timestamp.d.ts +0 -2
  112. package/esm/deps/deno.land/std@0.190.0/yaml/_type/undefined.d.ts +0 -2
  113. package/esm/deps/deno.land/std@0.190.0/yaml/_utils.d.ts +0 -19
  114. package/esm/deps/deno.land/std@0.190.0/yaml/parse.d.ts +0 -35
  115. package/esm/deps/deno.land/std@0.190.0/yaml/schema/core.d.ts +0 -2
  116. package/esm/deps/deno.land/std@0.190.0/yaml/schema/default.d.ts +0 -2
  117. package/esm/deps/deno.land/std@0.190.0/yaml/schema/extended.d.ts +0 -30
  118. package/esm/deps/deno.land/std@0.190.0/yaml/schema/failsafe.d.ts +0 -2
  119. package/esm/deps/deno.land/std@0.190.0/yaml/schema/json.d.ts +0 -2
  120. package/esm/deps/deno.land/std@0.190.0/yaml/schema/mod.d.ts +0 -5
  121. package/esm/deps/deno.land/std@0.190.0/yaml/schema.d.ts +0 -22
  122. package/esm/deps/deno.land/std@0.190.0/yaml/type.d.ts +0 -28
  123. package/esm/test/comment.test.d.ts +0 -1
  124. package/esm/test/escape.test.d.ts +0 -1
  125. package/esm/test/for.test.d.ts +0 -1
  126. package/esm/test/function.test.d.ts +0 -1
  127. package/esm/test/if.test.d.ts +0 -1
  128. package/esm/test/import.test.d.ts +0 -1
  129. package/esm/test/include.test.d.ts +0 -1
  130. package/esm/test/js.test.d.ts +0 -1
  131. package/esm/test/layout.test.d.ts +0 -1
  132. package/esm/test/print.test.d.ts +0 -1
  133. package/esm/test/raw.test.d.ts +0 -1
  134. package/esm/test/set.test.d.ts +0 -1
  135. package/esm/test/tokenizer.test.d.ts +0 -1
  136. package/esm/test/utils.d.ts +0 -24
  137. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_constants.d.ts +0 -0
  138. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_constants.js +0 -0
  139. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_interface.d.ts +0 -0
  140. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/_interface.js +0 -0
  141. /package/esm/deps/deno.land/{std@0.178.0/_util/os.d.ts → std@0.201.0/path/_os.d.ts} +0 -0
  142. /package/esm/deps/deno.land/{std@0.178.0/_util/os.js → std@0.201.0/path/_os.js} +0 -0
  143. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/common.d.ts +0 -0
  144. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/common.js +0 -0
  145. /package/esm/deps/deno.land/{std@0.178.0 → std@0.201.0}/path/separator.d.ts +0 -0
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Return the extension of the `path` with leading period.
3
+ * @param path with extension
4
+ * @returns extension (ex. for `file.ts` returns `.ts`)
5
+ */
6
+ export declare function extname(path: string): string;
@@ -0,0 +1,12 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixExtname, windowsExtname } from "./_extname.js";
5
+ /**
6
+ * Return the extension of the `path` with leading period.
7
+ * @param path with extension
8
+ * @returns extension (ex. for `file.ts` returns `.ts`)
9
+ */
10
+ export function extname(path) {
11
+ return isWindows ? windowsExtname(path) : posixExtname(path);
12
+ }
@@ -0,0 +1,6 @@
1
+ import { FormatInputPathObject } from "./_interface.js";
2
+ /**
3
+ * Generate a path from `FormatInputPathObject` object.
4
+ * @param pathObject with path
5
+ */
6
+ export declare function format(pathObject: FormatInputPathObject): string;
@@ -0,0 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixFormat, windowsFormat } from "./_format.js";
5
+ /**
6
+ * Generate a path from `FormatInputPathObject` object.
7
+ * @param pathObject with path
8
+ */
9
+ export function format(pathObject) {
10
+ return isWindows ? windowsFormat(pathObject) : posixFormat(pathObject);
11
+ }
@@ -0,0 +1,18 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Converts a file URL to a path string.
4
+ *
5
+ * ```ts
6
+ * import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/from_file_url.ts";
7
+ *
8
+ * // posix
9
+ * fromFileUrl("file:///home/foo"); // "/home/foo"
10
+ *
11
+ * // win32
12
+ * fromFileUrl("file:///home/foo"); // "\\home\\foo"
13
+ * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
14
+ * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
15
+ * ```
16
+ * @param url of a file URL
17
+ */
18
+ export declare function fromFileUrl(url: string | URL): string;
@@ -0,0 +1,23 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixFromFileUrl, windowsFromFileUrl } from "./_from_file_url.js";
5
+ /**
6
+ * Converts a file URL to a path string.
7
+ *
8
+ * ```ts
9
+ * import { fromFileUrl } from "https://deno.land/std@$STD_VERSION/path/from_file_url.ts";
10
+ *
11
+ * // posix
12
+ * fromFileUrl("file:///home/foo"); // "/home/foo"
13
+ *
14
+ * // win32
15
+ * fromFileUrl("file:///home/foo"); // "\\home\\foo"
16
+ * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
17
+ * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
18
+ * ```
19
+ * @param url of a file URL
20
+ */
21
+ export function fromFileUrl(url) {
22
+ return isWindows ? windowsFromFileUrl(url) : posixFromFileUrl(url);
23
+ }
@@ -1,4 +1,4 @@
1
- import type { OSType } from "../_util/os.js";
1
+ import { type OSType } from "./_os.js";
2
2
  export interface GlobOptions {
3
3
  /** Extended glob syntax.
4
4
  * See https://www.linuxjournal.com/content/bash-extended-globbing.
@@ -1,6 +1,6 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { isWindows, osType } from "../_util/os.js";
3
+ import { isWindows, osType } from "./_os.js";
4
4
  import { SEP, SEP_PATTERN } from "./separator.js";
5
5
  import * as _win32 from "./win32.js";
6
6
  import * as _posix from "./posix.js";
@@ -79,17 +79,17 @@ const rangeEscapeChars = ["-", "\\", "]"];
79
79
  * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
80
80
  * the group occurs not nested at the end of the segment. */
81
81
  export function globToRegExp(glob, { extended = true, globstar: globstarOption = true, os = osType, caseInsensitive = false, } = {}) {
82
- if (glob == "") {
82
+ if (glob === "") {
83
83
  return /(?!)/;
84
84
  }
85
- const sep = os == "windows" ? "(?:\\\\|/)+" : "/+";
86
- const sepMaybe = os == "windows" ? "(?:\\\\|/)*" : "/*";
87
- const seps = os == "windows" ? ["\\", "/"] : ["/"];
88
- const globstar = os == "windows"
85
+ const sep = os === "windows" ? "(?:\\\\|/)+" : "/+";
86
+ const sepMaybe = os === "windows" ? "(?:\\\\|/)*" : "/*";
87
+ const seps = os === "windows" ? ["\\", "/"] : ["/"];
88
+ const globstar = os === "windows"
89
89
  ? "(?:[^\\\\/]*(?:\\\\|/|$)+)*"
90
90
  : "(?:[^/]*(?:/|$)+)*";
91
- const wildcard = os == "windows" ? "[^\\\\/]*" : "[^/]*";
92
- const escapePrefix = os == "windows" ? "`" : "\\";
91
+ const wildcard = os === "windows" ? "[^\\\\/]*" : "[^/]*";
92
+ const escapePrefix = os === "windows" ? "`" : "\\";
93
93
  // Remove trailing separators.
94
94
  let newLength = glob.length;
95
95
  for (; newLength > 1 && seps.includes(glob[newLength - 1]); newLength--)
@@ -112,73 +112,73 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
112
112
  segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
113
113
  continue;
114
114
  }
115
- if (glob[i] == escapePrefix) {
115
+ if (glob[i] === escapePrefix) {
116
116
  inEscape = true;
117
117
  continue;
118
118
  }
119
- if (glob[i] == "[") {
119
+ if (glob[i] === "[") {
120
120
  if (!inRange) {
121
121
  inRange = true;
122
122
  segment += "[";
123
- if (glob[i + 1] == "!") {
123
+ if (glob[i + 1] === "!") {
124
124
  i++;
125
125
  segment += "^";
126
126
  }
127
- else if (glob[i + 1] == "^") {
127
+ else if (glob[i + 1] === "^") {
128
128
  i++;
129
129
  segment += "\\^";
130
130
  }
131
131
  continue;
132
132
  }
133
- else if (glob[i + 1] == ":") {
133
+ else if (glob[i + 1] === ":") {
134
134
  let k = i + 1;
135
135
  let value = "";
136
- while (glob[k + 1] != null && glob[k + 1] != ":") {
136
+ while (glob[k + 1] !== undefined && glob[k + 1] !== ":") {
137
137
  value += glob[k + 1];
138
138
  k++;
139
139
  }
140
- if (glob[k + 1] == ":" && glob[k + 2] == "]") {
140
+ if (glob[k + 1] === ":" && glob[k + 2] === "]") {
141
141
  i = k + 2;
142
- if (value == "alnum")
142
+ if (value === "alnum")
143
143
  segment += "\\dA-Za-z";
144
- else if (value == "alpha")
144
+ else if (value === "alpha")
145
145
  segment += "A-Za-z";
146
- else if (value == "ascii")
146
+ else if (value === "ascii")
147
147
  segment += "\x00-\x7F";
148
- else if (value == "blank")
148
+ else if (value === "blank")
149
149
  segment += "\t ";
150
- else if (value == "cntrl")
150
+ else if (value === "cntrl")
151
151
  segment += "\x00-\x1F\x7F";
152
- else if (value == "digit")
152
+ else if (value === "digit")
153
153
  segment += "\\d";
154
- else if (value == "graph")
154
+ else if (value === "graph")
155
155
  segment += "\x21-\x7E";
156
- else if (value == "lower")
156
+ else if (value === "lower")
157
157
  segment += "a-z";
158
- else if (value == "print")
158
+ else if (value === "print")
159
159
  segment += "\x20-\x7E";
160
- else if (value == "punct") {
160
+ else if (value === "punct") {
161
161
  segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
162
162
  }
163
- else if (value == "space")
163
+ else if (value === "space")
164
164
  segment += "\\s\v";
165
- else if (value == "upper")
165
+ else if (value === "upper")
166
166
  segment += "A-Z";
167
- else if (value == "word")
167
+ else if (value === "word")
168
168
  segment += "\\w";
169
- else if (value == "xdigit")
169
+ else if (value === "xdigit")
170
170
  segment += "\\dA-Fa-f";
171
171
  continue;
172
172
  }
173
173
  }
174
174
  }
175
- if (glob[i] == "]" && inRange) {
175
+ if (glob[i] === "]" && inRange) {
176
176
  inRange = false;
177
177
  segment += "]";
178
178
  continue;
179
179
  }
180
180
  if (inRange) {
181
- if (glob[i] == "\\") {
181
+ if (glob[i] === "\\") {
182
182
  segment += `\\\\`;
183
183
  }
184
184
  else {
@@ -186,37 +186,37 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
186
186
  }
187
187
  continue;
188
188
  }
189
- if (glob[i] == ")" && groupStack.length > 0 &&
190
- groupStack[groupStack.length - 1] != "BRACE") {
189
+ if (glob[i] === ")" && groupStack.length > 0 &&
190
+ groupStack[groupStack.length - 1] !== "BRACE") {
191
191
  segment += ")";
192
192
  const type = groupStack.pop();
193
- if (type == "!") {
193
+ if (type === "!") {
194
194
  segment += wildcard;
195
195
  }
196
- else if (type != "@") {
196
+ else if (type !== "@") {
197
197
  segment += type;
198
198
  }
199
199
  continue;
200
200
  }
201
- if (glob[i] == "|" && groupStack.length > 0 &&
202
- groupStack[groupStack.length - 1] != "BRACE") {
201
+ if (glob[i] === "|" && groupStack.length > 0 &&
202
+ groupStack[groupStack.length - 1] !== "BRACE") {
203
203
  segment += "|";
204
204
  continue;
205
205
  }
206
- if (glob[i] == "+" && extended && glob[i + 1] == "(") {
206
+ if (glob[i] === "+" && extended && glob[i + 1] === "(") {
207
207
  i++;
208
208
  groupStack.push("+");
209
209
  segment += "(?:";
210
210
  continue;
211
211
  }
212
- if (glob[i] == "@" && extended && glob[i + 1] == "(") {
212
+ if (glob[i] === "@" && extended && glob[i + 1] === "(") {
213
213
  i++;
214
214
  groupStack.push("@");
215
215
  segment += "(?:";
216
216
  continue;
217
217
  }
218
- if (glob[i] == "?") {
219
- if (extended && glob[i + 1] == "(") {
218
+ if (glob[i] === "?") {
219
+ if (extended && glob[i + 1] === "(") {
220
220
  i++;
221
221
  groupStack.push("?");
222
222
  segment += "(?:";
@@ -226,28 +226,28 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
226
226
  }
227
227
  continue;
228
228
  }
229
- if (glob[i] == "!" && extended && glob[i + 1] == "(") {
229
+ if (glob[i] === "!" && extended && glob[i + 1] === "(") {
230
230
  i++;
231
231
  groupStack.push("!");
232
232
  segment += "(?!";
233
233
  continue;
234
234
  }
235
- if (glob[i] == "{") {
235
+ if (glob[i] === "{") {
236
236
  groupStack.push("BRACE");
237
237
  segment += "(?:";
238
238
  continue;
239
239
  }
240
- if (glob[i] == "}" && groupStack[groupStack.length - 1] == "BRACE") {
240
+ if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
241
241
  groupStack.pop();
242
242
  segment += ")";
243
243
  continue;
244
244
  }
245
- if (glob[i] == "," && groupStack[groupStack.length - 1] == "BRACE") {
245
+ if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
246
246
  segment += "|";
247
247
  continue;
248
248
  }
249
- if (glob[i] == "*") {
250
- if (extended && glob[i + 1] == "(") {
249
+ if (glob[i] === "*") {
250
+ if (extended && glob[i + 1] === "(") {
251
251
  i++;
252
252
  groupStack.push("*");
253
253
  segment += "(?:";
@@ -255,12 +255,12 @@ export function globToRegExp(glob, { extended = true, globstar: globstarOption =
255
255
  else {
256
256
  const prevChar = glob[i - 1];
257
257
  let numStars = 1;
258
- while (glob[i + 1] == "*") {
258
+ while (glob[i + 1] === "*") {
259
259
  i++;
260
260
  numStars++;
261
261
  }
262
262
  const nextChar = glob[i + 1];
263
- if (globstarOption && numStars == 2 &&
263
+ if (globstarOption && numStars === 2 &&
264
264
  [...seps, undefined].includes(prevChar) &&
265
265
  [...seps, undefined].includes(nextChar)) {
266
266
  segment += globstar;
@@ -340,7 +340,7 @@ export function normalizeGlob(glob, { globstar = false } = {}) {
340
340
  }
341
341
  /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
342
342
  export function joinGlobs(globs, { extended = true, globstar = false } = {}) {
343
- if (!globstar || globs.length == 0) {
343
+ if (!globstar || globs.length === 0) {
344
344
  return join(...globs);
345
345
  }
346
346
  if (globs.length === 0)
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Verifies whether provided path is absolute
3
+ * @param path to be verified as absolute
4
+ */
5
+ export declare function isAbsolute(path: string): boolean;
@@ -0,0 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixIsAbsolute, windowsIsAbsolute } from "./_is_absolute.js";
5
+ /**
6
+ * Verifies whether provided path is absolute
7
+ * @param path to be verified as absolute
8
+ */
9
+ export function isAbsolute(path) {
10
+ return isWindows ? windowsIsAbsolute(path) : posixIsAbsolute(path);
11
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
3
+ * @param paths to be joined and normalized
4
+ */
5
+ export declare function join(...paths: string[]): string;
@@ -0,0 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixJoin, windowsJoin } from "./_join.js";
5
+ /**
6
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
7
+ * @param paths to be joined and normalized
8
+ */
9
+ export function join(...paths) {
10
+ return isWindows ? windowsJoin(...paths) : posixJoin(...paths);
11
+ }
@@ -0,0 +1,22 @@
1
+ import * as _win32 from "./win32.js";
2
+ import * as _posix from "./posix.js";
3
+ export declare const win32: typeof _win32;
4
+ export declare const posix: typeof _posix;
5
+ export declare const delimiter: string;
6
+ export * from "./basename.js";
7
+ export * from "./dirname.js";
8
+ export * from "./extname.js";
9
+ export * from "./format.js";
10
+ export * from "./from_file_url.js";
11
+ export * from "./is_absolute.js";
12
+ export * from "./join.js";
13
+ export * from "./normalize.js";
14
+ export * from "./parse.js";
15
+ export * from "./relative.js";
16
+ export * from "./resolve.js";
17
+ export * from "./to_file_url.js";
18
+ export * from "./to_namespaced_path.js";
19
+ export * from "./common.js";
20
+ export * from "./separator.js";
21
+ export * from "./_interface.js";
22
+ export * from "./glob.js";
@@ -1,6 +1,7 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // Copyright the Browserify authors. MIT License.
3
3
  // Ported mostly from https://github.com/browserify/path-browserify/
4
+ // This module is browser compatible.
4
5
  /**
5
6
  * Utilities for working with OS-specific file paths.
6
7
  *
@@ -19,14 +20,26 @@
19
20
  *
20
21
  * @module
21
22
  */
22
- import { isWindows } from "../_util/os.js";
23
+ import { isWindows } from "./_os.js";
23
24
  import * as _win32 from "./win32.js";
24
25
  import * as _posix from "./posix.js";
25
- const path = isWindows ? _win32 : _posix;
26
26
  export const win32 = _win32;
27
27
  export const posix = _posix;
28
- export const { basename, delimiter, dirname, extname, format, fromFileUrl, isAbsolute, join, normalize, parse, relative, resolve, sep, toFileUrl, toNamespacedPath, } = path;
28
+ export const delimiter = isWindows ? win32.delimiter : posix.delimiter;
29
+ export * from "./basename.js";
30
+ export * from "./dirname.js";
31
+ export * from "./extname.js";
32
+ export * from "./format.js";
33
+ export * from "./from_file_url.js";
34
+ export * from "./is_absolute.js";
35
+ export * from "./join.js";
36
+ export * from "./normalize.js";
37
+ export * from "./parse.js";
38
+ export * from "./relative.js";
39
+ export * from "./resolve.js";
40
+ export * from "./to_file_url.js";
41
+ export * from "./to_namespaced_path.js";
29
42
  export * from "./common.js";
30
- export { SEP, SEP_PATTERN } from "./separator.js";
43
+ export * from "./separator.js";
31
44
  export * from "./_interface.js";
32
45
  export * from "./glob.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
3
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
4
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
5
+ * @param path to be normalized
6
+ */
7
+ export declare function normalize(path: string): string;
@@ -0,0 +1,13 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixNormalize, windowsNormalize } from "./_normalize.js";
5
+ /**
6
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
7
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
8
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
9
+ * @param path to be normalized
10
+ */
11
+ export function normalize(path) {
12
+ return isWindows ? windowsNormalize(path) : posixNormalize(path);
13
+ }
@@ -0,0 +1,6 @@
1
+ import type { ParsedPath } from "./_interface.js";
2
+ /**
3
+ * Return a `ParsedPath` object of the `path`.
4
+ * @param path to process
5
+ */
6
+ export declare function parse(path: string): ParsedPath;
@@ -0,0 +1,11 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixParse, windowsParse } from "./_parse.js";
5
+ /**
6
+ * Return a `ParsedPath` object of the `path`.
7
+ * @param path to process
8
+ */
9
+ export function parse(path) {
10
+ return isWindows ? windowsParse(path) : posixParse(path);
11
+ }
@@ -0,0 +1,15 @@
1
+ export declare const sep = "/";
2
+ export declare const delimiter = ":";
3
+ export { posixResolve as resolve } from "./_resolve.js";
4
+ export { posixNormalize as normalize } from "./_normalize.js";
5
+ export { posixIsAbsolute as isAbsolute } from "./_is_absolute.js";
6
+ export { posixJoin as join } from "./_join.js";
7
+ export { posixRelative as relative } from "./_relative.js";
8
+ export { posixToNamespacedPath as toNamespacedPath } from "./_to_namespaced_path.js";
9
+ export { posixDirname as dirname } from "./_dirname.js";
10
+ export { posixBasename as basename } from "./_basename.js";
11
+ export { posixExtname as extname } from "./_extname.js";
12
+ export { posixFormat as format } from "./_format.js";
13
+ export { posixParse as parse } from "./_parse.js";
14
+ export { posixFromFileUrl as fromFileUrl } from "./_from_file_url.js";
15
+ export { posixToFileUrl as toFileUrl } from "./_to_file_url.js";
@@ -0,0 +1,19 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // Copyright the Browserify authors. MIT License.
3
+ // Ported from https://github.com/browserify/path-browserify/
4
+ // This module is browser compatible.
5
+ export const sep = "/";
6
+ export const delimiter = ":";
7
+ export { posixResolve as resolve } from "./_resolve.js";
8
+ export { posixNormalize as normalize } from "./_normalize.js";
9
+ export { posixIsAbsolute as isAbsolute } from "./_is_absolute.js";
10
+ export { posixJoin as join } from "./_join.js";
11
+ export { posixRelative as relative } from "./_relative.js";
12
+ export { posixToNamespacedPath as toNamespacedPath } from "./_to_namespaced_path.js";
13
+ export { posixDirname as dirname } from "./_dirname.js";
14
+ export { posixBasename as basename } from "./_basename.js";
15
+ export { posixExtname as extname } from "./_extname.js";
16
+ export { posixFormat as format } from "./_format.js";
17
+ export { posixParse as parse } from "./_parse.js";
18
+ export { posixFromFileUrl as fromFileUrl } from "./_from_file_url.js";
19
+ export { posixToFileUrl as toFileUrl } from "./_to_file_url.js";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Return the relative path from `from` to `to` based on current working directory.
3
+ *
4
+ * An example in windws, for instance:
5
+ * from = 'C:\\orandea\\test\\aaa'
6
+ * to = 'C:\\orandea\\impl\\bbb'
7
+ * The output of the function should be: '..\\..\\impl\\bbb'
8
+ *
9
+ * @param from path in current working directory
10
+ * @param to path in current working directory
11
+ */
12
+ export declare function relative(from: string, to: string): string;
@@ -0,0 +1,18 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixRelative, windowsRelative } from "./_relative.js";
5
+ /**
6
+ * Return the relative path from `from` to `to` based on current working directory.
7
+ *
8
+ * An example in windws, for instance:
9
+ * from = 'C:\\orandea\\test\\aaa'
10
+ * to = 'C:\\orandea\\impl\\bbb'
11
+ * The output of the function should be: '..\\..\\impl\\bbb'
12
+ *
13
+ * @param from path in current working directory
14
+ * @param to path in current working directory
15
+ */
16
+ export function relative(from, to) {
17
+ return isWindows ? windowsRelative(from, to) : posixRelative(from, to);
18
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolves path segments into a `path`
3
+ * @param pathSegments to process to path
4
+ */
5
+ export declare function resolve(...pathSegments: string[]): string;
@@ -0,0 +1,13 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixResolve, windowsResolve } from "./_resolve.js";
5
+ /**
6
+ * Resolves path segments into a `path`
7
+ * @param pathSegments to process to path
8
+ */
9
+ export function resolve(...pathSegments) {
10
+ return isWindows
11
+ ? windowsResolve(...pathSegments)
12
+ : posixResolve(...pathSegments);
13
+ }
@@ -1,5 +1,5 @@
1
1
  // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { isWindows } from "../_util/os.js";
3
+ import { isWindows } from "./_os.js";
4
4
  export const SEP = isWindows ? "\\" : "/";
5
5
  export const SEP_PATTERN = isWindows ? /[\\/]+/ : /\/+/;
@@ -0,0 +1,18 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * Converts a path string to a file URL.
4
+ *
5
+ * ```ts
6
+ * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/to_file_url.ts";
7
+ *
8
+ * // posix
9
+ * toFileUrl("/home/foo"); // new URL("file:///home/foo")
10
+ *
11
+ * // win32
12
+ * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
13
+ * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
14
+ * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
15
+ * ```
16
+ * @param path to convert to file URL
17
+ */
18
+ export declare function toFileUrl(path: string): URL;
@@ -0,0 +1,23 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixToFileUrl, windowsToFileUrl } from "./_to_file_url.js";
5
+ /**
6
+ * Converts a path string to a file URL.
7
+ *
8
+ * ```ts
9
+ * import { toFileUrl } from "https://deno.land/std@$STD_VERSION/path/to_file_url.ts";
10
+ *
11
+ * // posix
12
+ * toFileUrl("/home/foo"); // new URL("file:///home/foo")
13
+ *
14
+ * // win32
15
+ * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
16
+ * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
17
+ * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
18
+ * ```
19
+ * @param path to convert to file URL
20
+ */
21
+ export function toFileUrl(path) {
22
+ return isWindows ? windowsToFileUrl(path) : posixToFileUrl(path);
23
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolves path to a namespace path
3
+ * @param path to resolve to namespace
4
+ */
5
+ export declare function toNamespacedPath(path: string): string;
@@ -0,0 +1,13 @@
1
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { isWindows } from "./_os.js";
4
+ import { posixToNamespacedPath, windowsToNamespacedPath, } from "./_to_namespaced_path.js";
5
+ /**
6
+ * Resolves path to a namespace path
7
+ * @param path to resolve to namespace
8
+ */
9
+ export function toNamespacedPath(path) {
10
+ return isWindows
11
+ ? windowsToNamespacedPath(path)
12
+ : posixToNamespacedPath(path);
13
+ }