mol_compare_deep 0.0.1088 → 0.0.1090

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/node.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/compare/deep/deep.ts","mol/compare/deep/README.md"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"ts":121,"LICENSE":113,"md":493,"js":9,"json":82,"tree":41,"CNAME":1},"deps":{"mol/compare/deep":{"..":-9007199254740991,"/mol/compare/deep/cache":-1,"/mol/compare/deep":-1,"/mol/compare/deep/cache/get":-2,"/mol/compare/deep/cache/set":-3},"mol/compare":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{}}}
1
+ {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/compare/deep/deep.ts","mol/compare/deep/README.md"],"mods":{},"deps_in":{"mol/compare":{"mol/compare/deep":-9007199254740991},"mol":{"mol/compare":-9007199254740991},"":{"mol":-9007199254740991}},"deps_out":{"mol/compare/deep":{"mol/compare":-9007199254740991},"mol/compare":{"mol":-9007199254740991},"mol":{"":-9007199254740991}},"sloc":{"ts":121,"LICENSE":113,"md":493,"js":9,"json":83,"tree":41,"CNAME":1},"deps":{"mol/compare/deep":{"..":-9007199254740991,"/mol/compare/deep/cache":-1,"/mol/compare/deep":-1,"/mol/compare/deep/cache/get":-2,"/mol/compare/deep/cache/set":-3},"mol/compare":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{}}}
package/node.test.js CHANGED
@@ -2062,7 +2062,7 @@ var $;
2062
2062
  "use strict";
2063
2063
  var $;
2064
2064
  (function ($) {
2065
- const handled = new WeakSet();
2065
+ const wrappers = new WeakMap();
2066
2066
  class $mol_wire_fiber extends $mol_wire_pub_sub {
2067
2067
  task;
2068
2068
  host;
@@ -2197,13 +2197,21 @@ var $;
2197
2197
  result = this.task.call(this.host, ...this.args);
2198
2198
  break;
2199
2199
  }
2200
- if ($mol_promise_like(result) && !handled.has(result)) {
2201
- const put = (res) => {
2202
- if (this.cache === result)
2203
- this.put(res);
2204
- return res;
2205
- };
2206
- result = result.then(put, put);
2200
+ if ($mol_promise_like(result)) {
2201
+ if (wrappers.has(result)) {
2202
+ result = wrappers.get(result).then(a => a);
2203
+ }
2204
+ else {
2205
+ const put = (res) => {
2206
+ if (this.cache === result)
2207
+ this.put(res);
2208
+ return res;
2209
+ };
2210
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
2211
+ wrappers.set(result, result);
2212
+ const error = new Error(`Promise in ${this}`);
2213
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
2214
+ }
2207
2215
  }
2208
2216
  }
2209
2217
  catch (error) {
@@ -2213,21 +2221,20 @@ var $;
2213
2221
  else {
2214
2222
  result = new Error(String(error), { cause: error });
2215
2223
  }
2216
- if ($mol_promise_like(result) && !handled.has(result)) {
2217
- result = result.finally(() => {
2218
- if (this.cache === result)
2219
- this.absorb();
2220
- });
2224
+ if ($mol_promise_like(result)) {
2225
+ if (wrappers.has(result)) {
2226
+ result = wrappers.get(result);
2227
+ }
2228
+ else {
2229
+ wrappers.set(result, result = Object.assign(result.finally(() => {
2230
+ if (this.cache === result)
2231
+ this.absorb();
2232
+ }), { destructor: result.destructor || (() => { }) }));
2233
+ const error = new Error(`Promise in ${this}`);
2234
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
2235
+ }
2221
2236
  }
2222
2237
  }
2223
- if ($mol_promise_like(result) && !handled.has(result)) {
2224
- result = Object.assign(result, {
2225
- destructor: result['destructor'] ?? (() => { })
2226
- });
2227
- handled.add(result);
2228
- const error = new Error(`Promise in ${this}`);
2229
- Object.defineProperty(result, 'stack', { get: () => error.stack });
2230
- }
2231
2238
  if (!$mol_promise_like(result)) {
2232
2239
  this.track_cut();
2233
2240
  }
@@ -2287,6 +2294,12 @@ var $;
2287
2294
  };
2288
2295
  });
2289
2296
  }
2297
+ destructor() {
2298
+ super.destructor();
2299
+ if ($mol_owning_check(this, this.cache)) {
2300
+ this.cache.destructor();
2301
+ }
2302
+ }
2290
2303
  }
2291
2304
  $.$mol_wire_fiber = $mol_wire_fiber;
2292
2305
  })($ || ($ = {}));
@@ -2399,7 +2412,8 @@ var $;
2399
2412
  $$.$mol_log3_warn({
2400
2413
  place: '$mol_wire_task',
2401
2414
  message: `Non idempotency`,
2402
- existen,
2415
+ sub,
2416
+ pubs: [...sub?.pub_list ?? [], existen],
2403
2417
  next,
2404
2418
  hint: 'Ignore it',
2405
2419
  });
@@ -2422,6 +2436,14 @@ var $;
2422
2436
  this.cursor = $mol_wire_cursor.fresh;
2423
2437
  if (next !== prev)
2424
2438
  this.emit();
2439
+ if ($mol_owning_catch(this, next)) {
2440
+ try {
2441
+ next[Symbol.toStringTag] = this[Symbol.toStringTag];
2442
+ }
2443
+ catch {
2444
+ Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
2445
+ }
2446
+ }
2425
2447
  return next;
2426
2448
  }
2427
2449
  this.cursor = $mol_wire_cursor.final;
@@ -2985,6 +3007,17 @@ var $;
2985
3007
  ;
2986
3008
  "use strict";
2987
3009
 
3010
+ ;
3011
+ "use strict";
3012
+ var $;
3013
+ (function ($) {
3014
+ function $mol_dom_serialize(node) {
3015
+ const serializer = new $mol_dom_context.XMLSerializer;
3016
+ return serializer.serializeToString(node);
3017
+ }
3018
+ $.$mol_dom_serialize = $mol_dom_serialize;
3019
+ })($ || ($ = {}));
3020
+
2988
3021
  ;
2989
3022
  "use strict";
2990
3023
  var $;
@@ -3142,6 +3175,19 @@ var $;
3142
3175
  "!");
3143
3176
  $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
3144
3177
  },
3178
+ 'Make fragment'() {
3179
+ const dom = $mol_jsx($mol_jsx_frag, null,
3180
+ $mol_jsx("br", null),
3181
+ $mol_jsx("hr", null));
3182
+ $mol_assert_equal($mol_dom_serialize(dom), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />');
3183
+ },
3184
+ 'Spread fragment'() {
3185
+ const dom = $mol_jsx("div", null,
3186
+ $mol_jsx($mol_jsx_frag, null,
3187
+ $mol_jsx("br", null),
3188
+ $mol_jsx("hr", null)));
3189
+ $mol_assert_equal(dom.outerHTML, '<div><br><hr></div>');
3190
+ },
3145
3191
  'Function as component'() {
3146
3192
  const Button = (props, target) => {
3147
3193
  return $mol_jsx("button", { title: props.hint }, target());