@percy/core 1.7.1 → 1.8.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/dist/utils.js +8 -4
- package/package.json +6 -6
- package/types/index.d.ts +2 -0
package/dist/utils.js
CHANGED
|
@@ -108,15 +108,19 @@ export class AbortError extends Error {
|
|
|
108
108
|
} // An async generator that yields after every event loop until the promise settles
|
|
109
109
|
|
|
110
110
|
export async function* yieldTo(subject) {
|
|
111
|
-
|
|
111
|
+
// yield to any provided generator or return non-promise values
|
|
112
|
+
if (isGenerator(subject)) return yield* subject;
|
|
113
|
+
if (typeof (subject === null || subject === void 0 ? void 0 : subject.then) !== 'function') return subject; // update local variables with the provided promise
|
|
112
114
|
|
|
113
|
-
let
|
|
114
|
-
|
|
115
|
+
let result,
|
|
116
|
+
error,
|
|
117
|
+
pending = !!subject.then(r => result = r, e => error = e).finally(() => pending = false);
|
|
115
118
|
/* eslint-disable-next-line no-unmodified-loop-condition */
|
|
116
119
|
|
|
117
120
|
while (pending) yield new Promise(r => setImmediate(r));
|
|
118
121
|
|
|
119
|
-
|
|
122
|
+
if (error) throw error;
|
|
123
|
+
return result;
|
|
120
124
|
} // An async generator that runs provided generators concurrently
|
|
121
125
|
|
|
122
126
|
export async function* yieldAll(all) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"test:types": "tsd"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@percy/client": "1.
|
|
43
|
-
"@percy/config": "1.
|
|
44
|
-
"@percy/dom": "1.
|
|
45
|
-
"@percy/logger": "1.
|
|
42
|
+
"@percy/client": "1.8.1",
|
|
43
|
+
"@percy/config": "1.8.1",
|
|
44
|
+
"@percy/dom": "1.8.1",
|
|
45
|
+
"@percy/logger": "1.8.1",
|
|
46
46
|
"content-disposition": "^0.5.4",
|
|
47
47
|
"cross-spawn": "^7.0.3",
|
|
48
48
|
"extract-zip": "^2.0.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
54
|
"ws": "^8.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "497772c62e2fa2d763b350c40a0cfec918f7125f"
|
|
57
57
|
}
|
package/types/index.d.ts
CHANGED