appium-safari-driver 6.0.0 → 6.0.1
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.
- package/CHANGELOG.md +6 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +10 -6
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +8 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -1
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -1
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +3 -4
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +10 -6
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js +8 -1
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -1
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +3 -4
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -1
- package/node_modules/asyncbox/lib/asyncfilter.ts +10 -6
- package/node_modules/asyncbox/lib/asyncmap.ts +8 -4
- package/node_modules/asyncbox/lib/wait-for-condition.ts +3 -4
- package/node_modules/asyncbox/package.json +1 -1
- package/node_modules/bare-buffer/CMakeLists.txt +3 -3
- package/node_modules/bare-buffer/README.md +4 -0
- package/node_modules/bare-buffer/package.json +2 -2
- package/node_modules/bare-buffer/prebuilds/android-arm/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-ia32/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/android-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/darwin-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/darwin-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-arm64-simulator/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/ios-x64-simulator/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/linux-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/linux-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/win32-arm64/bare-buffer.bare +0 -0
- package/node_modules/bare-buffer/prebuilds/win32-x64/bare-buffer.bare +0 -0
- package/node_modules/bare-path/README.md +8 -0
- package/node_modules/bare-path/binding.c +33 -12
- package/node_modules/bare-path/index.d.ts +64 -0
- package/node_modules/bare-path/package.json +1 -1
- package/node_modules/bare-path/prebuilds/android-arm/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-ia32/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/android-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/darwin-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-arm64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/ios-x64-simulator/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/linux-x64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-arm64/bare-path.bare +0 -0
- package/node_modules/bare-path/prebuilds/win32-x64/bare-path.bare +0 -0
- package/node_modules/bare-url/CMakeLists.txt +5 -5
- package/node_modules/bare-url/package.json +2 -2
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- package/node_modules/brace-expansion/README.md +30 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +2 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +222 -36
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.d.ts +2 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +222 -36
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [6.0.1](https://github.com/appium/appium-safari-driver/compare/v6.0.0...v6.0.1) (2026-11-13)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* **deps:** bump appium to 4.0.0-beta.8 ([#206](https://github.com/appium/appium-safari-driver/issues/206)) ([d1de6e7](https://github.com/appium/appium-safari-driver/commit/d1de6e7501375e7132d683aed70e833c24e30e2b))
|
|
6
|
+
|
|
1
7
|
## [6.0.0](https://github.com/appium/appium-safari-driver/compare/v5.0.11...v6.0.0) (2026-11-09)
|
|
2
8
|
|
|
3
9
|
### ⚠ BREAKING CHANGES
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CA4Bd"}
|
|
@@ -15,13 +15,17 @@ async function asyncfilter(coll, filter, options = true) {
|
|
|
15
15
|
// limitFunction requires the filter to always return a promise
|
|
16
16
|
const filterAsync = async (value) => filter(value);
|
|
17
17
|
if (options === false) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const items = coll.slice();
|
|
19
|
+
const results = [];
|
|
20
|
+
for (let i = 0; i < items.length; i++) {
|
|
21
|
+
if (i in items) {
|
|
22
|
+
const item = items[i];
|
|
23
|
+
if (await filterAsync(item)) {
|
|
24
|
+
results.push(item);
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
}
|
|
28
|
+
return results;
|
|
25
29
|
}
|
|
26
30
|
const adjustedFilter = options === true ? filterAsync : (await (0, limit_function_js_1.getLimitFunction)())(filterAsync, { concurrency: options.concurrency });
|
|
27
31
|
const bools = await Promise.all(coll.map(adjustedFilter));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":";;AASA,
|
|
1
|
+
{"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":";;AASA,kCAgCC;AAzCD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAC/B,IAAS,EACT,MAAgD,EAChD,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAoB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC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CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"asyncmap.d.ts","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAmBd"}
|
|
@@ -15,7 +15,14 @@ async function asyncmap(coll, mapper, options = true) {
|
|
|
15
15
|
// limitFunction requires the mapper to always return a promise
|
|
16
16
|
const mapperAsync = async (value) => mapper(value);
|
|
17
17
|
if (options === false) {
|
|
18
|
-
|
|
18
|
+
const items = coll.slice();
|
|
19
|
+
const results = [];
|
|
20
|
+
for (let i = 0; i < items.length; i++) {
|
|
21
|
+
if (i in items) {
|
|
22
|
+
results.push(await mapperAsync(items[i]));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return results;
|
|
19
26
|
}
|
|
20
27
|
const adjustedMapper = options === true ? mapperAsync : (await (0, limit_function_js_1.getLimitFunction)())(mapperAsync, { concurrency: options.concurrency });
|
|
21
28
|
return Promise.all(coll.map(adjustedMapper));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":";;AASA,
|
|
1
|
+
{"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":";;AASA,4BAuBC;AAhCD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAC5B,IAAS,EAC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AAC,CAAC,GAAG,CAAC,EAC5B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"wait-for-condition.d.ts","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC5B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,CAAC,CAAC,CA6BZ"}
|
|
@@ -28,7 +28,7 @@ async function waitForCondition(condFn, options = {}) {
|
|
|
28
28
|
const error = opts.error;
|
|
29
29
|
const begunAt = performance.now();
|
|
30
30
|
const endAt = begunAt + opts.waitMs;
|
|
31
|
-
|
|
31
|
+
for (;;) {
|
|
32
32
|
const result = await condFn();
|
|
33
33
|
if (result) {
|
|
34
34
|
return result;
|
|
@@ -39,14 +39,13 @@ async function waitForCondition(condFn, options = {}) {
|
|
|
39
39
|
if (now < endAt) {
|
|
40
40
|
debug(`Waited for ${waited} ms so far`);
|
|
41
41
|
await (0, sleep_js_1.sleep)(Math.min(opts.intervalMs, remainingTime));
|
|
42
|
-
|
|
42
|
+
continue;
|
|
43
43
|
}
|
|
44
44
|
// if there is an error option, it is either a string message or an error itself
|
|
45
45
|
if (error) {
|
|
46
46
|
throw typeof error === 'string' ? new errors_js_1.ConditionUnmetError(error) : error;
|
|
47
47
|
}
|
|
48
48
|
throw new errors_js_1.ConditionUnmetError(`Condition unmet after ${waited} ms. Timing out.`);
|
|
49
|
-
}
|
|
50
|
-
return await spin();
|
|
49
|
+
}
|
|
51
50
|
}
|
|
52
51
|
//# sourceMappingURL=wait-for-condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-condition.js","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":";;AAmBA,
|
|
1
|
+
{"version":3,"file":"wait-for-condition.js","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":";;AAmBA,4CAgCC;AAnDD,2CAAgD;AAChD,yCAAiC;AAGjC;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA4B,EAC5B,UAAmC,EAAE;IAErC,MAAM,IAAI,GAAmE;QAC3E,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;QAClE,UAAU,EAAE,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG;KAC9E,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;IAClF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IACpC,SAAS,CAAC;QACR,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,CAAC;QAC9B,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,KAAK,GAAG,GAAG,CAAC;QAClC,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,cAAc,MAAM,YAAY,CAAC,CAAC;YACxC,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;YACtD,SAAS;QACX,CAAC;QACD,gFAAgF;QAChF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,+BAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,+BAAmB,CAAC,yBAAyB,MAAM,kBAAkB,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CA4Bd"}
|
|
@@ -12,13 +12,17 @@ export async function asyncfilter(coll, filter, options = true) {
|
|
|
12
12
|
// limitFunction requires the filter to always return a promise
|
|
13
13
|
const filterAsync = async (value) => filter(value);
|
|
14
14
|
if (options === false) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const items = coll.slice();
|
|
16
|
+
const results = [];
|
|
17
|
+
for (let i = 0; i < items.length; i++) {
|
|
18
|
+
if (i in items) {
|
|
19
|
+
const item = items[i];
|
|
20
|
+
if (await filterAsync(item)) {
|
|
21
|
+
results.push(item);
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
}
|
|
25
|
+
return results;
|
|
22
26
|
}
|
|
23
27
|
const adjustedFilter = options === true ? filterAsync : (await getLimitFunction())(filterAsync, { concurrency: options.concurrency });
|
|
24
28
|
const bools = await Promise.all(coll.map(adjustedFilter));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAS,EACT,MAAgD,EAChD,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAoB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,
|
|
1
|
+
{"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD;;;;;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;YACb,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncmap.d.ts","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"asyncmap.d.ts","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAmBd"}
|
|
@@ -12,7 +12,14 @@ export async function asyncmap(coll, mapper, options = true) {
|
|
|
12
12
|
// limitFunction requires the mapper to always return a promise
|
|
13
13
|
const mapperAsync = async (value) => mapper(value);
|
|
14
14
|
if (options === false) {
|
|
15
|
-
|
|
15
|
+
const items = coll.slice();
|
|
16
|
+
const results = [];
|
|
17
|
+
for (let i = 0; i < items.length; i++) {
|
|
18
|
+
if (i in items) {
|
|
19
|
+
results.push(await mapperAsync(items[i]));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return results;
|
|
16
23
|
}
|
|
17
24
|
const adjustedMapper = options === true ? mapperAsync : (await getLimitFunction())(mapperAsync, { concurrency: options.concurrency });
|
|
18
25
|
return Promise.all(coll.map(adjustedMapper));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAS,EACT,MAAoC,EACpC,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAc,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,
|
|
1
|
+
{"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAS,EACT,MAAoC,EACpC,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAc,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,cAAc,GAClB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC,WAAW,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAC,CAAC,CAAC;IAC/G,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-condition.d.ts","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC5B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"wait-for-condition.d.ts","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAC5B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,CAAC,CAAC,CA6BZ"}
|
|
@@ -25,7 +25,7 @@ export async function waitForCondition(condFn, options = {}) {
|
|
|
25
25
|
const error = opts.error;
|
|
26
26
|
const begunAt = performance.now();
|
|
27
27
|
const endAt = begunAt + opts.waitMs;
|
|
28
|
-
|
|
28
|
+
for (;;) {
|
|
29
29
|
const result = await condFn();
|
|
30
30
|
if (result) {
|
|
31
31
|
return result;
|
|
@@ -36,14 +36,13 @@ export async function waitForCondition(condFn, options = {}) {
|
|
|
36
36
|
if (now < endAt) {
|
|
37
37
|
debug(`Waited for ${waited} ms so far`);
|
|
38
38
|
await sleep(Math.min(opts.intervalMs, remainingTime));
|
|
39
|
-
|
|
39
|
+
continue;
|
|
40
40
|
}
|
|
41
41
|
// if there is an error option, it is either a string message or an error itself
|
|
42
42
|
if (error) {
|
|
43
43
|
throw typeof error === 'string' ? new ConditionUnmetError(error) : error;
|
|
44
44
|
}
|
|
45
45
|
throw new ConditionUnmetError(`Condition unmet after ${waited} ms. Timing out.`);
|
|
46
|
-
}
|
|
47
|
-
return await spin();
|
|
46
|
+
}
|
|
48
47
|
}
|
|
49
48
|
//# sourceMappingURL=wait-for-condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-condition.js","sourceRoot":"","sources":["../../../lib/wait-for-condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAGjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAA4B,EAC5B,UAAmC,EAAE;IAErC,MAAM,IAAI,GAAmE;QAC3E,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;QAClE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AAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IACpC,SAAS,CAAC;QACR,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,CAAC;QAC9B,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,KAAK,GAAG,GAAG,CAAC;QAClC,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,cAAc,MAAM,YAAY,CAAC,CAAC;YACxC,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;YACtD,SAAS;QACX,CAAC;QACD,gFAAgF;QAChF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,mBAAmB,CAAC,yBAAyB,MAAM,kBAAkB,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
|
|
@@ -18,13 +18,17 @@ export async function asyncfilter<T>(
|
|
|
18
18
|
// limitFunction requires the filter to always return a promise
|
|
19
19
|
const filterAsync = async (value: T): Promise<boolean> => filter(value);
|
|
20
20
|
if (options === false) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const items = coll.slice();
|
|
22
|
+
const results: T[] = [];
|
|
23
|
+
for (let i = 0; i < items.length; i++) {
|
|
24
|
+
if (i in items) {
|
|
25
|
+
const item = items[i];
|
|
26
|
+
if (await filterAsync(item)) {
|
|
27
|
+
results.push(item);
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
}
|
|
31
|
+
return results;
|
|
28
32
|
}
|
|
29
33
|
const adjustedFilter =
|
|
30
34
|
options === true ? filterAsync : (await getLimitFunction())(filterAsync, {concurrency: options.concurrency});
|
|
@@ -18,10 +18,14 @@ export async function asyncmap<T, R>(
|
|
|
18
18
|
// limitFunction requires the mapper to always return a promise
|
|
19
19
|
const mapperAsync = async (value: T): Promise<R> => mapper(value);
|
|
20
20
|
if (options === false) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const items = coll.slice();
|
|
22
|
+
const results: R[] = [];
|
|
23
|
+
for (let i = 0; i < items.length; i++) {
|
|
24
|
+
if (i in items) {
|
|
25
|
+
results.push(await mapperAsync(items[i]));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return results;
|
|
25
29
|
}
|
|
26
30
|
const adjustedMapper =
|
|
27
31
|
options === true ? mapperAsync : (await getLimitFunction())(mapperAsync, {concurrency: options.concurrency});
|
|
@@ -30,7 +30,7 @@ export async function waitForCondition<T>(
|
|
|
30
30
|
const error = opts.error;
|
|
31
31
|
const begunAt = performance.now();
|
|
32
32
|
const endAt = begunAt + opts.waitMs;
|
|
33
|
-
|
|
33
|
+
for (;;) {
|
|
34
34
|
const result = await condFn();
|
|
35
35
|
if (result) {
|
|
36
36
|
return result;
|
|
@@ -41,13 +41,12 @@ export async function waitForCondition<T>(
|
|
|
41
41
|
if (now < endAt) {
|
|
42
42
|
debug(`Waited for ${waited} ms so far`);
|
|
43
43
|
await sleep(Math.min(opts.intervalMs, remainingTime));
|
|
44
|
-
|
|
44
|
+
continue;
|
|
45
45
|
}
|
|
46
46
|
// if there is an error option, it is either a string message or an error itself
|
|
47
47
|
if (error) {
|
|
48
48
|
throw typeof error === 'string' ? new ConditionUnmetError(error) : error;
|
|
49
49
|
}
|
|
50
50
|
throw new ConditionUnmetError(`Condition unmet after ${waited} ms. Timing out.`);
|
|
51
|
-
}
|
|
52
|
-
return await spin();
|
|
51
|
+
}
|
|
53
52
|
}
|
|
@@ -5,9 +5,9 @@ find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch)
|
|
|
5
5
|
|
|
6
6
|
project(bare_buffer C)
|
|
7
7
|
|
|
8
|
-
fetch_package("github:holepunchto/libutf#
|
|
9
|
-
fetch_package("github:holepunchto/libbase64#
|
|
10
|
-
fetch_package("github:holepunchto/libhex#
|
|
8
|
+
fetch_package("github:holepunchto/libutf#a7f9f6b")
|
|
9
|
+
fetch_package("github:holepunchto/libbase64#f466fb8")
|
|
10
|
+
fetch_package("github:holepunchto/libhex#5611279")
|
|
11
11
|
|
|
12
12
|
add_bare_module(bare_buffer)
|
|
13
13
|
|
|
@@ -21,6 +21,10 @@ const combined = Buffer.concat([buffer, buffer])
|
|
|
21
21
|
|
|
22
22
|
See the [`bare-buffer` reference](https://docs.pears.com/reference/bare/modules/bare-buffer).
|
|
23
23
|
|
|
24
|
+
## Threat model
|
|
25
|
+
|
|
26
|
+
`bare-buffer` is one of the addons Bare compiles into its binary, so it inherits [Bare's threat model](https://github.com/holepunchto/bare/blob/main/docs/threat-model.md). See [`docs/threat-model.md`](docs/threat-model.md) for where this addon sits in it.
|
|
27
|
+
|
|
24
28
|
## License
|
|
25
29
|
|
|
26
30
|
Apache-2.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-buffer",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "Native buffers for JavaScript",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package": "./package.json",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"bare-realm": "^2.0.1",
|
|
52
52
|
"brittle": "^3.1.1",
|
|
53
|
-
"cmake-bare": "^1.
|
|
53
|
+
"cmake-bare": "^1.13.0",
|
|
54
54
|
"cmake-fetch": "^1.0.0",
|
|
55
55
|
"lunte": "^1.8.0",
|
|
56
56
|
"prettier": "^3.3.3",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -14,6 +14,14 @@ const path = require('bare-path')
|
|
|
14
14
|
path.join('foo', 'bar') // foo/bar on posix, foo\bar on windows
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
See the [`bare-path` reference](https://docs.pears.com/reference/bare/modules/bare-path).
|
|
20
|
+
|
|
21
|
+
## Threat model
|
|
22
|
+
|
|
23
|
+
`bare-path` is one of the addons Bare compiles into its binary, so it inherits [Bare's threat model](https://github.com/holepunchto/bare/blob/main/docs/threat-model.md). See [`docs/threat-model.md`](docs/threat-model.md) for where this addon sits in it.
|
|
24
|
+
|
|
17
25
|
## License
|
|
18
26
|
|
|
19
27
|
Apache-2.0
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include <bare.h>
|
|
3
3
|
#include <js.h>
|
|
4
4
|
#include <stddef.h>
|
|
5
|
+
#include <stdlib.h>
|
|
5
6
|
#include <utf.h>
|
|
6
7
|
#include <uv.h>
|
|
7
8
|
|
|
@@ -47,39 +48,59 @@ bare_path_cwd(js_env_t *env, js_callback_info_t *info) {
|
|
|
47
48
|
) {
|
|
48
49
|
char name[4] = {'=', (char) device[0], ':', '\0'};
|
|
49
50
|
|
|
50
|
-
char
|
|
51
|
-
|
|
51
|
+
char buffer[256];
|
|
52
|
+
char *value = buffer;
|
|
53
|
+
size_t value_len = sizeof(buffer);
|
|
52
54
|
|
|
53
55
|
err = uv_os_getenv(name, value, &value_len);
|
|
54
56
|
|
|
57
|
+
// The stack buffer only has to fit the common case. A longer value has
|
|
58
|
+
// its length reported and is read again into a buffer that fits it.
|
|
59
|
+
if (err == UV_ENOBUFS) {
|
|
60
|
+
value = malloc(value_len);
|
|
61
|
+
|
|
62
|
+
err = uv_os_getenv(name, value, &value_len);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
js_value_t *result = NULL;
|
|
66
|
+
|
|
55
67
|
// Fall through to the process working directory when the variable is
|
|
56
68
|
// unset or otherwise cannot be read.
|
|
57
69
|
if (err == 0) {
|
|
58
|
-
js_value_t *result;
|
|
59
70
|
err = js_create_string_utf8(env, (utf8_t *) value, value_len, &result);
|
|
60
71
|
assert(err == 0);
|
|
61
|
-
|
|
62
|
-
return result;
|
|
63
72
|
}
|
|
73
|
+
|
|
74
|
+
if (value != buffer) free(value);
|
|
75
|
+
|
|
76
|
+
if (result) return result;
|
|
64
77
|
}
|
|
65
78
|
}
|
|
66
79
|
}
|
|
67
80
|
|
|
68
|
-
char
|
|
69
|
-
|
|
81
|
+
char buffer[256];
|
|
82
|
+
char *cwd = buffer;
|
|
83
|
+
size_t cwd_len = sizeof(buffer);
|
|
70
84
|
|
|
71
85
|
err = uv_cwd(cwd, &cwd_len);
|
|
72
86
|
|
|
87
|
+
if (err == UV_ENOBUFS) {
|
|
88
|
+
cwd = malloc(cwd_len);
|
|
89
|
+
|
|
90
|
+
err = uv_cwd(cwd, &cwd_len);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
js_value_t *result = NULL;
|
|
94
|
+
|
|
73
95
|
if (err < 0) {
|
|
74
96
|
err = js_throw_error(env, uv_err_name(err), uv_strerror(err));
|
|
75
97
|
assert(err == 0);
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
} else {
|
|
99
|
+
err = js_create_string_utf8(env, (utf8_t *) cwd, cwd_len, &result);
|
|
100
|
+
assert(err == 0);
|
|
78
101
|
}
|
|
79
102
|
|
|
80
|
-
|
|
81
|
-
err = js_create_string_utf8(env, (utf8_t *) cwd, cwd_len, &result);
|
|
82
|
-
assert(err == 0);
|
|
103
|
+
if (cwd != buffer) free(cwd);
|
|
83
104
|
|
|
84
105
|
return result;
|
|
85
106
|
}
|
|
@@ -1,26 +1,90 @@
|
|
|
1
|
+
/** Path manipulation utilities, mirroring Node.js's `path` module. */
|
|
1
2
|
declare namespace path {
|
|
3
|
+
/** The platform-specific path segment separator: `\` on Windows, `/` elsewhere. */
|
|
2
4
|
export const sep: '/' | '\\'
|
|
5
|
+
/** The platform-specific path delimiter: `;` on Windows, `:` elsewhere. */
|
|
3
6
|
export const delimiter: ':' | ';'
|
|
4
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Returns the last portion of `path`, similar to the Unix `basename` command.
|
|
10
|
+
* @param path - The path to extract the last portion from.
|
|
11
|
+
* @param suffix - An optional suffix to remove from the end of the result, if it matches exactly.
|
|
12
|
+
* @returns An empty string if `suffix` equals `path` exactly.
|
|
13
|
+
* @throws {TypeError} thrown if `path`, or a defined `suffix`, is not a string.
|
|
14
|
+
*/
|
|
5
15
|
export function basename(path: string, suffix?: string): string
|
|
6
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Returns the directory name of `path`, similar to the Unix `dirname` command.
|
|
19
|
+
* @param path - The path to extract the directory name from.
|
|
20
|
+
* @throws {TypeError} thrown if `path` is not a string.
|
|
21
|
+
*/
|
|
7
22
|
export function dirname(path: string): string
|
|
8
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Returns the extension of `path`, from the last `.` to the end of the string.
|
|
26
|
+
* @param path - The path to extract the extension from.
|
|
27
|
+
* @returns An empty string if `path` has no `.` in its last segment, or if that segment's only
|
|
28
|
+
* `.` is its first character (for example a dotfile).
|
|
29
|
+
* @throws {TypeError} thrown if `path` is not a string.
|
|
30
|
+
*/
|
|
9
31
|
export function extname(path: string): string
|
|
10
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Returns `true` if `path` is an absolute path.
|
|
35
|
+
* @param path - The path to test.
|
|
36
|
+
* @returns On Windows, a drive-qualified path such as `C:\foo` is also absolute; on POSIX, only
|
|
37
|
+
* paths starting with `/` are absolute.
|
|
38
|
+
* @throws {TypeError} thrown if `path` is not a string.
|
|
39
|
+
*/
|
|
11
40
|
export function isAbsolute(path: string): boolean
|
|
12
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Joins all given path segments using the platform-specific separator, then normalizes the
|
|
44
|
+
* result.
|
|
45
|
+
* @param paths - The path segments to join together, in the order given.
|
|
46
|
+
* @throws {TypeError} thrown if any path segment is not a string.
|
|
47
|
+
*/
|
|
13
48
|
export function join(...paths: string[]): string
|
|
14
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Normalizes `path`, resolving `.` and `..` segments.
|
|
52
|
+
* @param path - The path to normalize.
|
|
53
|
+
* @throws {TypeError} thrown if `path` is not a string.
|
|
54
|
+
*/
|
|
15
55
|
export function normalize(path: string): string
|
|
16
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Returns the relative path from `from` to `to`.
|
|
59
|
+
* @param from - The path to resolve the relative path from.
|
|
60
|
+
* @param to - The path to resolve the relative path to.
|
|
61
|
+
* @returns Both `from` and `to` are resolved to absolute paths before comparing, and an empty
|
|
62
|
+
* string is returned if they resolve to the same path.
|
|
63
|
+
* @throws {TypeError} thrown if `from` or `to` is not a string.
|
|
64
|
+
*/
|
|
17
65
|
export function relative(from: string, to: string): string
|
|
18
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Resolves a sequence of paths or path segments into an absolute path.
|
|
69
|
+
* @param args - The path segments to resolve, processed from right to left until an absolute path
|
|
70
|
+
* is constructed.
|
|
71
|
+
* @returns Falls back to the current working directory (or that of the resolved drive, on
|
|
72
|
+
* Windows) if none of the given segments is absolute.
|
|
73
|
+
* @throws {TypeError} thrown if any path segment is not a string.
|
|
74
|
+
*/
|
|
19
75
|
export function resolve(...args: string[]): string
|
|
20
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Converts `path` to a namespace-prefixed path on Windows; returns `path` unchanged on POSIX.
|
|
79
|
+
* @param path - The path to convert.
|
|
80
|
+
* @returns On Windows, resolves `path` and prefixes UNC paths with `\\?\UNC\` and drive-letter
|
|
81
|
+
* paths with `\\?\`; other paths (including non-string input) are returned unchanged.
|
|
82
|
+
*/
|
|
21
83
|
export function toNamespacedPath(path: string): string
|
|
22
84
|
|
|
85
|
+
/** The POSIX-specific implementation of the `path` methods. */
|
|
23
86
|
export const posix = path
|
|
87
|
+
/** The Windows-specific implementation of the `path` methods. */
|
|
24
88
|
export const win32 = path
|
|
25
89
|
}
|
|
26
90
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|