scrapfly-sdk 0.6.2 → 0.6.5

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 (118) hide show
  1. package/README.md +4 -2
  2. package/esm/client.d.ts +17 -14
  3. package/esm/client.d.ts.map +1 -1
  4. package/esm/client.js +63 -24
  5. package/esm/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.d.ts +0 -1
  6. package/esm/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.d.ts.map +1 -1
  7. package/esm/deps/jsr.io/@std/path/1.0.1/from_file_url.d.ts +0 -1
  8. package/esm/deps/jsr.io/@std/path/1.0.1/from_file_url.d.ts.map +1 -1
  9. package/esm/deps/jsr.io/@std/path/1.0.1/posix/from_file_url.d.ts +0 -1
  10. package/esm/deps/jsr.io/@std/path/1.0.1/posix/from_file_url.d.ts.map +1 -1
  11. package/esm/deps/jsr.io/@std/path/1.0.1/posix/to_file_url.d.ts +0 -1
  12. package/esm/deps/jsr.io/@std/path/1.0.1/posix/to_file_url.d.ts.map +1 -1
  13. package/esm/deps/jsr.io/@std/path/1.0.1/to_file_url.d.ts +0 -1
  14. package/esm/deps/jsr.io/@std/path/1.0.1/to_file_url.d.ts.map +1 -1
  15. package/esm/deps/jsr.io/@std/path/1.0.1/windows/from_file_url.d.ts +0 -1
  16. package/esm/deps/jsr.io/@std/path/1.0.1/windows/from_file_url.d.ts.map +1 -1
  17. package/esm/deps/jsr.io/@std/path/1.0.1/windows/to_file_url.d.ts +0 -1
  18. package/esm/deps/jsr.io/@std/path/1.0.1/windows/to_file_url.d.ts.map +1 -1
  19. package/esm/polyfill.d.ts +5 -0
  20. package/esm/polyfill.d.ts.map +1 -0
  21. package/esm/polyfill.js +20 -0
  22. package/esm/result.d.ts +0 -1
  23. package/esm/result.d.ts.map +1 -1
  24. package/esm/result.js +9 -5
  25. package/esm/utils.d.ts +9 -2
  26. package/esm/utils.d.ts.map +1 -1
  27. package/esm/utils.js +20 -2
  28. package/package.json +1 -1
  29. package/script/client.d.ts +17 -14
  30. package/script/client.d.ts.map +1 -1
  31. package/script/client.js +63 -24
  32. package/script/deps/jsr.io/@std/path/1.0.1/_common/assert_path.js +1 -2
  33. package/script/deps/jsr.io/@std/path/1.0.1/_common/basename.js +3 -4
  34. package/script/deps/jsr.io/@std/path/1.0.1/_common/common.js +1 -2
  35. package/script/deps/jsr.io/@std/path/1.0.1/_common/dirname.js +1 -2
  36. package/script/deps/jsr.io/@std/path/1.0.1/_common/format.js +2 -3
  37. package/script/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.d.ts +0 -1
  38. package/script/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.d.ts.map +1 -1
  39. package/script/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.js +1 -2
  40. package/script/deps/jsr.io/@std/path/1.0.1/_common/glob_to_reg_exp.js +1 -2
  41. package/script/deps/jsr.io/@std/path/1.0.1/_common/normalize.js +1 -2
  42. package/script/deps/jsr.io/@std/path/1.0.1/_common/normalize_string.js +1 -2
  43. package/script/deps/jsr.io/@std/path/1.0.1/_common/relative.js +1 -2
  44. package/script/deps/jsr.io/@std/path/1.0.1/_common/strip_trailing_separators.js +1 -2
  45. package/script/deps/jsr.io/@std/path/1.0.1/_common/to_file_url.js +1 -2
  46. package/script/deps/jsr.io/@std/path/1.0.1/basename.js +1 -2
  47. package/script/deps/jsr.io/@std/path/1.0.1/common.js +1 -2
  48. package/script/deps/jsr.io/@std/path/1.0.1/dirname.js +1 -2
  49. package/script/deps/jsr.io/@std/path/1.0.1/extname.js +1 -2
  50. package/script/deps/jsr.io/@std/path/1.0.1/format.js +1 -2
  51. package/script/deps/jsr.io/@std/path/1.0.1/from_file_url.d.ts +0 -1
  52. package/script/deps/jsr.io/@std/path/1.0.1/from_file_url.d.ts.map +1 -1
  53. package/script/deps/jsr.io/@std/path/1.0.1/from_file_url.js +1 -2
  54. package/script/deps/jsr.io/@std/path/1.0.1/glob_to_regexp.js +1 -2
  55. package/script/deps/jsr.io/@std/path/1.0.1/is_absolute.js +1 -2
  56. package/script/deps/jsr.io/@std/path/1.0.1/is_glob.js +1 -2
  57. package/script/deps/jsr.io/@std/path/1.0.1/join.js +1 -2
  58. package/script/deps/jsr.io/@std/path/1.0.1/join_globs.js +1 -2
  59. package/script/deps/jsr.io/@std/path/1.0.1/normalize.js +1 -2
  60. package/script/deps/jsr.io/@std/path/1.0.1/normalize_glob.js +1 -2
  61. package/script/deps/jsr.io/@std/path/1.0.1/parse.js +1 -2
  62. package/script/deps/jsr.io/@std/path/1.0.1/posix/_util.js +1 -2
  63. package/script/deps/jsr.io/@std/path/1.0.1/posix/basename.js +1 -2
  64. package/script/deps/jsr.io/@std/path/1.0.1/posix/dirname.js +1 -2
  65. package/script/deps/jsr.io/@std/path/1.0.1/posix/extname.js +1 -2
  66. package/script/deps/jsr.io/@std/path/1.0.1/posix/format.js +1 -2
  67. package/script/deps/jsr.io/@std/path/1.0.1/posix/from_file_url.d.ts +0 -1
  68. package/script/deps/jsr.io/@std/path/1.0.1/posix/from_file_url.d.ts.map +1 -1
  69. package/script/deps/jsr.io/@std/path/1.0.1/posix/from_file_url.js +1 -2
  70. package/script/deps/jsr.io/@std/path/1.0.1/posix/glob_to_regexp.js +1 -2
  71. package/script/deps/jsr.io/@std/path/1.0.1/posix/is_absolute.js +1 -2
  72. package/script/deps/jsr.io/@std/path/1.0.1/posix/join.js +1 -2
  73. package/script/deps/jsr.io/@std/path/1.0.1/posix/join_globs.js +1 -2
  74. package/script/deps/jsr.io/@std/path/1.0.1/posix/normalize.js +1 -2
  75. package/script/deps/jsr.io/@std/path/1.0.1/posix/normalize_glob.js +1 -2
  76. package/script/deps/jsr.io/@std/path/1.0.1/posix/parse.js +1 -2
  77. package/script/deps/jsr.io/@std/path/1.0.1/posix/relative.js +1 -2
  78. package/script/deps/jsr.io/@std/path/1.0.1/posix/resolve.js +1 -2
  79. package/script/deps/jsr.io/@std/path/1.0.1/posix/to_file_url.d.ts +0 -1
  80. package/script/deps/jsr.io/@std/path/1.0.1/posix/to_file_url.d.ts.map +1 -1
  81. package/script/deps/jsr.io/@std/path/1.0.1/posix/to_file_url.js +1 -2
  82. package/script/deps/jsr.io/@std/path/1.0.1/posix/to_namespaced_path.js +1 -2
  83. package/script/deps/jsr.io/@std/path/1.0.1/relative.js +1 -2
  84. package/script/deps/jsr.io/@std/path/1.0.1/resolve.js +1 -2
  85. package/script/deps/jsr.io/@std/path/1.0.1/to_file_url.d.ts +0 -1
  86. package/script/deps/jsr.io/@std/path/1.0.1/to_file_url.d.ts.map +1 -1
  87. package/script/deps/jsr.io/@std/path/1.0.1/to_file_url.js +1 -2
  88. package/script/deps/jsr.io/@std/path/1.0.1/to_namespaced_path.js +1 -2
  89. package/script/deps/jsr.io/@std/path/1.0.1/windows/_util.js +3 -4
  90. package/script/deps/jsr.io/@std/path/1.0.1/windows/basename.js +1 -2
  91. package/script/deps/jsr.io/@std/path/1.0.1/windows/dirname.js +1 -2
  92. package/script/deps/jsr.io/@std/path/1.0.1/windows/extname.js +1 -2
  93. package/script/deps/jsr.io/@std/path/1.0.1/windows/format.js +1 -2
  94. package/script/deps/jsr.io/@std/path/1.0.1/windows/from_file_url.d.ts +0 -1
  95. package/script/deps/jsr.io/@std/path/1.0.1/windows/from_file_url.d.ts.map +1 -1
  96. package/script/deps/jsr.io/@std/path/1.0.1/windows/from_file_url.js +1 -2
  97. package/script/deps/jsr.io/@std/path/1.0.1/windows/glob_to_regexp.js +1 -2
  98. package/script/deps/jsr.io/@std/path/1.0.1/windows/is_absolute.js +1 -2
  99. package/script/deps/jsr.io/@std/path/1.0.1/windows/join.js +1 -2
  100. package/script/deps/jsr.io/@std/path/1.0.1/windows/join_globs.js +1 -2
  101. package/script/deps/jsr.io/@std/path/1.0.1/windows/normalize.js +1 -2
  102. package/script/deps/jsr.io/@std/path/1.0.1/windows/normalize_glob.js +1 -2
  103. package/script/deps/jsr.io/@std/path/1.0.1/windows/parse.js +1 -2
  104. package/script/deps/jsr.io/@std/path/1.0.1/windows/relative.js +1 -2
  105. package/script/deps/jsr.io/@std/path/1.0.1/windows/resolve.js +1 -2
  106. package/script/deps/jsr.io/@std/path/1.0.1/windows/to_file_url.d.ts +0 -1
  107. package/script/deps/jsr.io/@std/path/1.0.1/windows/to_file_url.d.ts.map +1 -1
  108. package/script/deps/jsr.io/@std/path/1.0.1/windows/to_file_url.js +1 -2
  109. package/script/deps/jsr.io/@std/path/1.0.1/windows/to_namespaced_path.js +1 -2
  110. package/script/polyfill.d.ts +5 -0
  111. package/script/polyfill.d.ts.map +1 -0
  112. package/script/polyfill.js +48 -0
  113. package/script/result.d.ts +0 -1
  114. package/script/result.d.ts.map +1 -1
  115. package/script/result.js +9 -5
  116. package/script/utils.d.ts +9 -2
  117. package/script/utils.d.ts.map +1 -1
  118. package/script/utils.js +23 -5
package/script/client.js CHANGED
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ScrapflyClient = void 0;
27
- const dntShim = __importStar(require("./_dnt.shims.js"));
28
27
  const deps_js_1 = require("./deps.js");
28
+ const polyfill_js_1 = require("./polyfill.js");
29
29
  const utils_js_1 = require("./utils.js");
30
30
  const errors = __importStar(require("./errors.js"));
31
31
  const result_js_1 = require("./result.js");
@@ -131,6 +131,39 @@ class ScrapflyClient {
131
131
  }
132
132
  return new errors.ScrapflyError(message, args);
133
133
  }
134
+ /**
135
+ * Handle clob and blob large objects
136
+ */
137
+ async handleLargeObjects(result, format) {
138
+ let response;
139
+ try {
140
+ const url = new URL(result.content);
141
+ const params = { key: this.key };
142
+ url.search = new URLSearchParams(params).toString();
143
+ response = await this.fetch({
144
+ url: url.toString(),
145
+ method: 'GET',
146
+ headers: {
147
+ 'user-agent': this.ua,
148
+ 'accept-encoding': 'gzip, deflate, br',
149
+ accept: 'application/json',
150
+ },
151
+ });
152
+ }
153
+ catch (e) {
154
+ logger_js_1.log.error('error', e);
155
+ throw e;
156
+ }
157
+ const content = await response.text();
158
+ result.content = content;
159
+ if (format === 'clob') {
160
+ result.format = 'text';
161
+ }
162
+ if (format === 'blob') {
163
+ result.format = 'binary';
164
+ }
165
+ return result;
166
+ }
134
167
  /**
135
168
  * Turn scrapfly API response to ScrapeResult or raise one of ScrapflyError
136
169
  */
@@ -153,14 +186,15 @@ class ScrapflyClient {
153
186
  const url = new URL(this.HOST + '/account');
154
187
  const params = { key: this.key };
155
188
  url.search = new URLSearchParams(params).toString();
156
- response = await this.fetch(new Request(url.toString(), {
189
+ response = await this.fetch({
190
+ url: url.toString(),
157
191
  method: 'GET',
158
192
  headers: {
159
193
  'user-agent': this.ua,
160
194
  'accept-encoding': 'gzip, deflate, br',
161
195
  accept: 'application/json',
162
196
  },
163
- }));
197
+ });
164
198
  }
165
199
  catch (e) {
166
200
  logger_js_1.log.error('error', e);
@@ -185,7 +219,8 @@ class ScrapflyClient {
185
219
  const url = new URL(this.HOST + '/scrape');
186
220
  const params = config.toApiParams({ key: this.key });
187
221
  url.search = new URLSearchParams(params).toString();
188
- response = await this.fetch(new Request(url.toString(), {
222
+ response = await this.fetch({
223
+ url: url.toString(),
189
224
  method: config.method,
190
225
  headers: {
191
226
  'user-agent': this.ua,
@@ -196,7 +231,7 @@ class ScrapflyClient {
196
231
  accept: 'application/json',
197
232
  },
198
233
  body: config.body,
199
- }));
234
+ });
200
235
  }
201
236
  catch (e) {
202
237
  logger_js_1.log.error('error', e);
@@ -210,6 +245,10 @@ class ScrapflyClient {
210
245
  }
211
246
  throw new errors.ApiHttpClientError(JSON.stringify(data));
212
247
  }
248
+ const content_format = data.result.format;
249
+ if (content_format === 'clob' || content_format === 'blob') {
250
+ data.result = await this.handleLargeObjects(data.result, content_format);
251
+ }
213
252
  const result = this.handleResponse(response, new result_js_1.ScrapeResult({
214
253
  config: data.config,
215
254
  context: data.context,
@@ -219,21 +258,21 @@ class ScrapflyClient {
219
258
  return result;
220
259
  }
221
260
  /**
222
- Concurrently scrape multiple configs
223
- This is a async generator call it like this:
261
+ Concurrently scrape multiple configs
262
+ This is a async generator call it like this:
224
263
 
225
- const results = [];
226
- const errors = [];
227
- for await (const resultOrError of client.concurrentScrape(configs)) {
228
- if (resultOrError instanceof Error) {
229
- errors.push(resultOrError);
230
- } else {
231
- results.push(resultOrError);
232
- }
233
- }
264
+ const results = [];
265
+ const errors = [];
266
+ for await (const resultOrError of client.concurrentScrape(configs)) {
267
+ if (resultOrError instanceof Error) {
268
+ errors.push(resultOrError);
269
+ } else {
270
+ results.push(resultOrError);
271
+ }
272
+ }
234
273
 
235
- @param concurrencyLimit: if not set it will be taken from your account info
236
- */
274
+ @param concurrencyLimit: if not set it will be taken from your account info
275
+ */
237
276
  async *concurrentScrape(configs, concurrencyLimit) {
238
277
  if (concurrencyLimit === undefined) {
239
278
  const account = await this.account();
@@ -276,7 +315,7 @@ class ScrapflyClient {
276
315
  const extension_name = result.metadata.extension_name;
277
316
  let file_path;
278
317
  if (savePath) {
279
- dntShim.Deno.mkdir(savePath, { recursive: true });
318
+ await (0, polyfill_js_1.mkdir)(savePath, { recursive: true });
280
319
  file_path = deps_js_1.path.join(savePath, `${name}.${extension_name}`);
281
320
  }
282
321
  else {
@@ -284,7 +323,7 @@ class ScrapflyClient {
284
323
  }
285
324
  const content = new Uint8Array(result.image);
286
325
  // Use Deno's write file method
287
- await dntShim.Deno.writeFile(file_path, content);
326
+ await (0, polyfill_js_1.writeFile)(file_path, content);
288
327
  }
289
328
  /**
290
329
  * Turn scrapfly screenshot API response to ScreenshotResult or raise one of ScrapflyError
@@ -315,7 +354,8 @@ class ScrapflyClient {
315
354
  const url = new URL(this.HOST + '/screenshot');
316
355
  const params = config.toApiParams({ key: this.key });
317
356
  url.search = new URLSearchParams(params).toString();
318
- const req = new Request(url.toString(), {
357
+ response = await this.fetch({
358
+ url: url.toString(),
319
359
  method: 'GET',
320
360
  headers: {
321
361
  'user-agent': this.ua,
@@ -323,7 +363,6 @@ class ScrapflyClient {
323
363
  accept: 'application/json',
324
364
  },
325
365
  });
326
- response = await this.fetch(req);
327
366
  }
328
367
  catch (e) {
329
368
  logger_js_1.log.error('error', e);
@@ -371,12 +410,12 @@ class ScrapflyClient {
371
410
  if (config.document_compression_format && config.document_compression_format) {
372
411
  headers['content-encoding'] = config.document_compression_format;
373
412
  }
374
- const req = new Request(url.toString(), {
413
+ response = await this.fetch({
414
+ url: url.toString(),
375
415
  method: 'POST',
376
416
  headers: headers,
377
417
  body: config.body,
378
418
  });
379
- response = await this.fetch(req);
380
419
  }
381
420
  catch (e) {
382
421
  logger_js_1.log.error('error', e);
@@ -2,10 +2,9 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // Copyright the Browserify authors. MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertPath = void 0;
5
+ exports.assertPath = assertPath;
6
6
  function assertPath(path) {
7
7
  if (typeof path !== "string") {
8
8
  throw new TypeError(`Path must be a string. Received ${JSON.stringify(path)}`);
9
9
  }
10
10
  }
11
- exports.assertPath = assertPath;
@@ -2,7 +2,9 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArgs = exports.lastPathSegment = exports.stripSuffix = void 0;
5
+ exports.stripSuffix = stripSuffix;
6
+ exports.lastPathSegment = lastPathSegment;
7
+ exports.assertArgs = assertArgs;
6
8
  const assert_path_js_1 = require("./assert_path.js");
7
9
  function stripSuffix(name, suffix) {
8
10
  if (suffix.length >= name.length) {
@@ -16,7 +18,6 @@ function stripSuffix(name, suffix) {
16
18
  }
17
19
  return name.slice(0, -suffix.length);
18
20
  }
19
- exports.stripSuffix = stripSuffix;
20
21
  function lastPathSegment(path, isSep, start = 0) {
21
22
  let matchedNonSeparator = false;
22
23
  let end = path.length;
@@ -34,7 +35,6 @@ function lastPathSegment(path, isSep, start = 0) {
34
35
  }
35
36
  return path.slice(start, end);
36
37
  }
37
- exports.lastPathSegment = lastPathSegment;
38
38
  function assertArgs(path, suffix) {
39
39
  (0, assert_path_js_1.assertPath)(path);
40
40
  if (path.length === 0)
@@ -43,4 +43,3 @@ function assertArgs(path, suffix) {
43
43
  throw new TypeError(`Suffix must be a string. Received ${JSON.stringify(suffix)}`);
44
44
  }
45
45
  }
46
- exports.assertArgs = assertArgs;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.common = void 0;
5
+ exports.common = common;
6
6
  function common(paths, sep) {
7
7
  const [first = "", ...remaining] = paths;
8
8
  const parts = first.split(sep);
@@ -24,4 +24,3 @@ function common(paths, sep) {
24
24
  }
25
25
  return parts.slice(0, endOfPrefix).join(sep) + append;
26
26
  }
27
- exports.common = common;
@@ -2,11 +2,10 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = void 0;
5
+ exports.assertArg = assertArg;
6
6
  const assert_path_js_1 = require("./assert_path.js");
7
7
  function assertArg(path) {
8
8
  (0, assert_path_js_1.assertPath)(path);
9
9
  if (path.length === 0)
10
10
  return ".";
11
11
  }
12
- exports.assertArg = assertArg;
@@ -2,7 +2,8 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = exports._format = void 0;
5
+ exports._format = _format;
6
+ exports.assertArg = assertArg;
6
7
  function _format(sep, pathObject) {
7
8
  const dir = pathObject.dir || pathObject.root;
8
9
  const base = pathObject.base ||
@@ -15,10 +16,8 @@ function _format(sep, pathObject) {
15
16
  return dir + base;
16
17
  return dir + sep + base;
17
18
  }
18
- exports._format = _format;
19
19
  function assertArg(pathObject) {
20
20
  if (pathObject === null || typeof pathObject !== "object") {
21
21
  throw new TypeError(`The "pathObject" argument must be of type Object. Received type ${typeof pathObject}`);
22
22
  }
23
23
  }
24
- exports.assertArg = assertArg;
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
1
  export declare function assertArg(url: URL | string): URL;
3
2
  //# sourceMappingURL=from_file_url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"from_file_url.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.ts"],"names":[],"mappings":";AAGA,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,OAM1C"}
1
+ {"version":3,"file":"from_file_url.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/path/1.0.1/_common/from_file_url.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,OAM1C"}
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = void 0;
5
+ exports.assertArg = assertArg;
6
6
  function assertArg(url) {
7
7
  url = url instanceof URL ? url : new URL(url);
8
8
  if (url.protocol !== "file:") {
@@ -10,4 +10,3 @@ function assertArg(url) {
10
10
  }
11
11
  return url;
12
12
  }
13
- exports.assertArg = assertArg;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports._globToRegExp = void 0;
5
+ exports._globToRegExp = _globToRegExp;
6
6
  const REG_EXP_ESCAPE_CHARS = [
7
7
  "!",
8
8
  "$",
@@ -235,4 +235,3 @@ caseInsensitive = false, } = {}) {
235
235
  regExpString = `^${regExpString}$`;
236
236
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
237
237
  }
238
- exports._globToRegExp = _globToRegExp;
@@ -2,11 +2,10 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArg = void 0;
5
+ exports.assertArg = assertArg;
6
6
  const assert_path_js_1 = require("./assert_path.js");
7
7
  function assertArg(path) {
8
8
  (0, assert_path_js_1.assertPath)(path);
9
9
  if (path.length === 0)
10
10
  return ".";
11
11
  }
12
- exports.assertArg = assertArg;
@@ -4,7 +4,7 @@
4
4
  // Ported from https://github.com/browserify/path-browserify/
5
5
  // This module is browser compatible.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeString = void 0;
7
+ exports.normalizeString = normalizeString;
8
8
  const constants_js_1 = require("./constants.js");
9
9
  // Resolves . and .. elements in a path with directory names
10
10
  function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
@@ -78,4 +78,3 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
78
78
  }
79
79
  return res;
80
80
  }
81
- exports.normalizeString = normalizeString;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.assertArgs = void 0;
5
+ exports.assertArgs = assertArgs;
6
6
  const assert_path_js_1 = require("./assert_path.js");
7
7
  function assertArgs(from, to) {
8
8
  (0, assert_path_js_1.assertPath)(from);
@@ -10,4 +10,3 @@ function assertArgs(from, to) {
10
10
  if (from === to)
11
11
  return "";
12
12
  }
13
- exports.assertArgs = assertArgs;
@@ -4,7 +4,7 @@
4
4
  // Ported from https://github.com/browserify/path-browserify/
5
5
  // This module is browser compatible.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.stripTrailingSeparators = void 0;
7
+ exports.stripTrailingSeparators = stripTrailingSeparators;
8
8
  function stripTrailingSeparators(segment, isSep) {
9
9
  if (segment.length <= 1) {
10
10
  return segment;
@@ -20,4 +20,3 @@ function stripTrailingSeparators(segment, isSep) {
20
20
  }
21
21
  return segment.slice(0, end);
22
22
  }
23
- exports.stripTrailingSeparators = stripTrailingSeparators;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.encodeWhitespace = void 0;
5
+ exports.encodeWhitespace = encodeWhitespace;
6
6
  const WHITESPACE_ENCODINGS = {
7
7
  "\u0009": "%09",
8
8
  "\u000A": "%0A",
@@ -16,4 +16,3 @@ function encodeWhitespace(string) {
16
16
  return WHITESPACE_ENCODINGS[c] ?? c;
17
17
  });
18
18
  }
19
- exports.encodeWhitespace = encodeWhitespace;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.basename = void 0;
5
+ exports.basename = basename;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const basename_js_1 = require("./posix/basename.js");
8
8
  const basename_js_2 = require("./windows/basename.js");
@@ -34,4 +34,3 @@ function basename(path, suffix = "") {
34
34
  ? (0, basename_js_2.basename)(path, suffix)
35
35
  : (0, basename_js_1.basename)(path, suffix);
36
36
  }
37
- exports.basename = basename;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.common = void 0;
5
+ exports.common = common;
6
6
  const common_js_1 = require("./_common/common.js");
7
7
  const constants_js_1 = require("./constants.js");
8
8
  /**
@@ -34,4 +34,3 @@ const constants_js_1 = require("./constants.js");
34
34
  function common(paths) {
35
35
  return (0, common_js_1.common)(paths, constants_js_1.SEPARATOR);
36
36
  }
37
- exports.common = common;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.dirname = void 0;
5
+ exports.dirname = dirname;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const dirname_js_1 = require("./posix/dirname.js");
8
8
  const dirname_js_2 = require("./windows/dirname.js");
@@ -27,4 +27,3 @@ const dirname_js_2 = require("./windows/dirname.js");
27
27
  function dirname(path) {
28
28
  return _os_js_1.isWindows ? (0, dirname_js_2.dirname)(path) : (0, dirname_js_1.dirname)(path);
29
29
  }
30
- exports.dirname = dirname;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.extname = void 0;
5
+ exports.extname = extname;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const extname_js_1 = require("./posix/extname.js");
8
8
  const extname_js_2 = require("./windows/extname.js");
@@ -27,4 +27,3 @@ const extname_js_2 = require("./windows/extname.js");
27
27
  function extname(path) {
28
28
  return _os_js_1.isWindows ? (0, extname_js_2.extname)(path) : (0, extname_js_1.extname)(path);
29
29
  }
30
- exports.extname = extname;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.format = void 0;
5
+ exports.format = format;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const format_js_1 = require("./posix/format.js");
8
8
  const format_js_2 = require("./windows/format.js");
@@ -28,4 +28,3 @@ const format_js_2 = require("./windows/format.js");
28
28
  function format(pathObject) {
29
29
  return _os_js_1.isWindows ? (0, format_js_2.format)(pathObject) : (0, format_js_1.format)(pathObject);
30
30
  }
31
- exports.format = format;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * Converts a file URL to a path string.
4
3
  *
@@ -1 +1 @@
1
- {"version":3,"file":"from_file_url.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/path/1.0.1/from_file_url.ts"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAErD"}
1
+ {"version":3,"file":"from_file_url.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/path/1.0.1/from_file_url.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAErD"}
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.fromFileUrl = void 0;
5
+ exports.fromFileUrl = fromFileUrl;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const from_file_url_js_1 = require("./posix/from_file_url.js");
8
8
  const from_file_url_js_2 = require("./windows/from_file_url.js");
@@ -29,4 +29,3 @@ const from_file_url_js_2 = require("./windows/from_file_url.js");
29
29
  function fromFileUrl(url) {
30
30
  return _os_js_1.isWindows ? (0, from_file_url_js_2.fromFileUrl)(url) : (0, from_file_url_js_1.fromFileUrl)(url);
31
31
  }
32
- exports.fromFileUrl = fromFileUrl;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.globToRegExp = void 0;
5
+ exports.globToRegExp = globToRegExp;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const glob_to_regexp_js_1 = require("./posix/glob_to_regexp.js");
8
8
  const glob_to_regexp_js_2 = require("./windows/glob_to_regexp.js");
@@ -84,4 +84,3 @@ function globToRegExp(glob, options = {}) {
84
84
  ? (0, glob_to_regexp_js_2.globToRegExp)(glob, options)
85
85
  : (0, glob_to_regexp_js_1.globToRegExp)(glob, options);
86
86
  }
87
- exports.globToRegExp = globToRegExp;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isAbsolute = void 0;
5
+ exports.isAbsolute = isAbsolute;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const is_absolute_js_1 = require("./posix/is_absolute.js");
8
8
  const is_absolute_js_2 = require("./windows/is_absolute.js");
@@ -29,4 +29,3 @@ const is_absolute_js_2 = require("./windows/is_absolute.js");
29
29
  function isAbsolute(path) {
30
30
  return _os_js_1.isWindows ? (0, is_absolute_js_2.isAbsolute)(path) : (0, is_absolute_js_1.isAbsolute)(path);
31
31
  }
32
- exports.isAbsolute = isAbsolute;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isGlob = void 0;
5
+ exports.isGlob = isGlob;
6
6
  /**
7
7
  * Test whether the given string is a glob.
8
8
  *
@@ -43,4 +43,3 @@ function isGlob(str) {
43
43
  }
44
44
  return false;
45
45
  }
46
- exports.isGlob = isGlob;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.join = void 0;
5
+ exports.join = join;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const join_js_1 = require("./posix/join.js");
8
8
  const join_js_2 = require("./windows/join.js");
@@ -27,4 +27,3 @@ const join_js_2 = require("./windows/join.js");
27
27
  function join(...paths) {
28
28
  return _os_js_1.isWindows ? (0, join_js_2.join)(...paths) : (0, join_js_1.join)(...paths);
29
29
  }
30
- exports.join = join;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.joinGlobs = void 0;
5
+ exports.joinGlobs = joinGlobs;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const join_globs_js_1 = require("./posix/join_globs.js");
8
8
  const join_globs_js_2 = require("./windows/join_globs.js");
@@ -35,4 +35,3 @@ function joinGlobs(globs, options = {}) {
35
35
  ? (0, join_globs_js_2.joinGlobs)(globs, options)
36
36
  : (0, join_globs_js_1.joinGlobs)(globs, options);
37
37
  }
38
- exports.joinGlobs = joinGlobs;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.normalize = void 0;
5
+ exports.normalize = normalize;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const normalize_js_1 = require("./posix/normalize.js");
8
8
  const normalize_js_2 = require("./windows/normalize.js");
@@ -31,4 +31,3 @@ const normalize_js_2 = require("./windows/normalize.js");
31
31
  function normalize(path) {
32
32
  return _os_js_1.isWindows ? (0, normalize_js_2.normalize)(path) : (0, normalize_js_1.normalize)(path);
33
33
  }
34
- exports.normalize = normalize;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.normalizeGlob = void 0;
5
+ exports.normalizeGlob = normalizeGlob;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const normalize_glob_js_1 = require("./posix/normalize_glob.js");
8
8
  const normalize_glob_js_2 = require("./windows/normalize_glob.js");
@@ -36,4 +36,3 @@ function normalizeGlob(glob, options = {}) {
36
36
  ? (0, normalize_glob_js_2.normalizeGlob)(glob, options)
37
37
  : (0, normalize_glob_js_1.normalizeGlob)(glob, options);
38
38
  }
39
- exports.normalizeGlob = normalizeGlob;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.parse = void 0;
5
+ exports.parse = parse;
6
6
  const _os_js_1 = require("./_os.js");
7
7
  const parse_js_1 = require("./posix/parse.js");
8
8
  const parse_js_2 = require("./windows/parse.js");
@@ -40,4 +40,3 @@ const parse_js_2 = require("./windows/parse.js");
40
40
  function parse(path) {
41
41
  return _os_js_1.isWindows ? (0, parse_js_2.parse)(path) : (0, parse_js_1.parse)(path);
42
42
  }
43
- exports.parse = parse;
@@ -4,9 +4,8 @@
4
4
  // Ported from https://github.com/browserify/path-browserify/
5
5
  // This module is browser compatible.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isPosixPathSeparator = void 0;
7
+ exports.isPosixPathSeparator = isPosixPathSeparator;
8
8
  const constants_js_1 = require("../_common/constants.js");
9
9
  function isPosixPathSeparator(code) {
10
10
  return code === constants_js_1.CHAR_FORWARD_SLASH;
11
11
  }
12
- exports.isPosixPathSeparator = isPosixPathSeparator;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.basename = void 0;
5
+ exports.basename = basename;
6
6
  const basename_js_1 = require("../_common/basename.js");
7
7
  const strip_trailing_separators_js_1 = require("../_common/strip_trailing_separators.js");
8
8
  const _util_js_1 = require("./_util.js");
@@ -30,4 +30,3 @@ function basename(path, suffix = "") {
30
30
  const strippedSegment = (0, strip_trailing_separators_js_1.stripTrailingSeparators)(lastSegment, _util_js_1.isPosixPathSeparator);
31
31
  return suffix ? (0, basename_js_1.stripSuffix)(strippedSegment, suffix) : strippedSegment;
32
32
  }
33
- exports.basename = basename;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
3
3
  // This module is browser compatible.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.dirname = void 0;
5
+ exports.dirname = dirname;
6
6
  const dirname_js_1 = require("../_common/dirname.js");
7
7
  const strip_trailing_separators_js_1 = require("../_common/strip_trailing_separators.js");
8
8
  const _util_js_1 = require("./_util.js");
@@ -48,4 +48,3 @@ function dirname(path) {
48
48
  }
49
49
  return (0, strip_trailing_separators_js_1.stripTrailingSeparators)(path.slice(0, end), _util_js_1.isPosixPathSeparator);
50
50
  }
51
- exports.dirname = dirname;