@omegup/msync 0.0.73 → 0.0.74
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/index.esm.js +13 -12
- package/index.js +13 -12
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1239,19 +1239,20 @@ class Machine {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
const wrap = (root) => root;
|
|
1241
1241
|
const runCont = async (it, cb) => {
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1242
|
+
while (true) {
|
|
1243
|
+
const { next, clear } = it();
|
|
1244
|
+
const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
|
|
1245
|
+
if (!res.ok) {
|
|
1246
|
+
console.error(res.err);
|
|
1247
|
+
process.exit(1);
|
|
1248
|
+
}
|
|
1249
|
+
const { cont, info } = res.next;
|
|
1250
|
+
if (cb?.(info)) {
|
|
1251
|
+
await clear();
|
|
1252
|
+
throw new Error('Machine stopped');
|
|
1253
|
+
}
|
|
1254
|
+
it = cont;
|
|
1253
1255
|
}
|
|
1254
|
-
return runCont(cont, cb);
|
|
1255
1256
|
};
|
|
1256
1257
|
|
|
1257
1258
|
const merge = ({ lsource: L, rsource: R, }) => mergeIterators({ sources: { L, R } });
|
package/index.js
CHANGED
|
@@ -1241,19 +1241,20 @@ class Machine {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
const wrap = (root) => root;
|
|
1243
1243
|
const runCont = async (it, cb) => {
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1244
|
+
while (true) {
|
|
1245
|
+
const { next, clear } = it();
|
|
1246
|
+
const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
|
|
1247
|
+
if (!res.ok) {
|
|
1248
|
+
console.error(res.err);
|
|
1249
|
+
process.exit(1);
|
|
1250
|
+
}
|
|
1251
|
+
const { cont, info } = res.next;
|
|
1252
|
+
if (cb?.(info)) {
|
|
1253
|
+
await clear();
|
|
1254
|
+
throw new Error('Machine stopped');
|
|
1255
|
+
}
|
|
1256
|
+
it = cont;
|
|
1255
1257
|
}
|
|
1256
|
-
return runCont(cont, cb);
|
|
1257
1258
|
};
|
|
1258
1259
|
|
|
1259
1260
|
const merge = ({ lsource: L, rsource: R, }) => mergeIterators({ sources: { L, R } });
|