@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.
Files changed (3) hide show
  1. package/index.esm.js +13 -12
  2. package/index.js +13 -12
  3. 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
- const { next, stop, clear } = it();
1243
- const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
1244
- if (!res.ok) {
1245
- console.error(res.err);
1246
- process.exit(1);
1247
- return runCont(stop, cb);
1248
- }
1249
- const { cont, info } = res.next;
1250
- if (cb?.(info)) {
1251
- await clear();
1252
- throw new Error('Machine stopped');
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
- const { next, stop, clear } = it();
1245
- const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
1246
- if (!res.ok) {
1247
- console.error(res.err);
1248
- process.exit(1);
1249
- return runCont(stop, cb);
1250
- }
1251
- const { cont, info } = res.next;
1252
- if (cb?.(info)) {
1253
- await clear();
1254
- throw new Error('Machine stopped');
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 } });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.esm.js",
4
4
  "typings": "index.d.ts",
5
5
  "name": "@omegup/msync",
6
- "version": "0.0.73",
6
+ "version": "0.0.74",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",