@mablhq/mabl-cli 1.21.4 → 1.21.6
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/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +4 -3
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +1 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +5 -0
- package/commands/tests/testsUtil.js +6 -3
- package/execution/index.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/package.json +1 -1
- package/resources/mablFind.js +1 -1
- package/util/asyncUtil.js +10 -1
package/util/asyncUtil.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimeoutError = exports.promiseWithTimeout = void 0;
|
|
3
|
+
exports.filterAsync = exports.mapAsync = exports.TimeoutError = exports.promiseWithTimeout = void 0;
|
|
4
4
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
5
5
|
async function promiseWithTimeout(promise, timeoutMillis, description) {
|
|
6
6
|
const startTimeMillis = new Date().getTime();
|
|
@@ -43,3 +43,12 @@ const startTimer = (timeoutMillis, description) => {
|
|
|
43
43
|
cancelTimer: () => global.clearTimeout(timeout),
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
function mapAsync(array, callback) {
|
|
47
|
+
return Promise.all(array.map(callback));
|
|
48
|
+
}
|
|
49
|
+
exports.mapAsync = mapAsync;
|
|
50
|
+
async function filterAsync(array, callback) {
|
|
51
|
+
const filterMap = await mapAsync(array, callback);
|
|
52
|
+
return array.filter((_, index) => filterMap[index]);
|
|
53
|
+
}
|
|
54
|
+
exports.filterAsync = filterAsync;
|