hyoo_sync_client 0.0.240 → 0.0.241

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/web.mjs CHANGED
@@ -1411,11 +1411,15 @@ var $;
1411
1411
  (function ($) {
1412
1412
  $.$mol_key_store = new WeakMap();
1413
1413
  function $mol_key(value) {
1414
+ if (typeof value === 'bigint')
1415
+ return value.toString() + 'n';
1414
1416
  if (!value)
1415
1417
  return JSON.stringify(value);
1416
1418
  if (typeof value !== 'object' && typeof value !== 'function')
1417
1419
  return JSON.stringify(value);
1418
1420
  return JSON.stringify(value, (field, value) => {
1421
+ if (typeof value === 'bigint')
1422
+ return value.toString() + 'n';
1419
1423
  if (!value)
1420
1424
  return value;
1421
1425
  if (typeof value !== 'object' && typeof value !== 'function')
@@ -2172,16 +2176,108 @@ var $;
2172
2176
  ;
2173
2177
  "use strict";
2174
2178
  var $;
2179
+ (function ($) {
2180
+ function $mol_wire_probe(task, def) {
2181
+ const warm = $mol_wire_fiber.warm;
2182
+ try {
2183
+ $mol_wire_fiber.warm = false;
2184
+ const res = task();
2185
+ if (res === undefined)
2186
+ return def;
2187
+ return res;
2188
+ }
2189
+ finally {
2190
+ $mol_wire_fiber.warm = warm;
2191
+ }
2192
+ }
2193
+ $.$mol_wire_probe = $mol_wire_probe;
2194
+ })($ || ($ = {}));
2195
+ //mol/wire/probe/probe.ts
2196
+ ;
2197
+ "use strict";
2198
+ var $;
2199
+ (function ($) {
2200
+ $.$mol_mem_cached = $mol_wire_probe;
2201
+ })($ || ($ = {}));
2202
+ //mol/mem/cached/cached.ts
2203
+ ;
2204
+ "use strict";
2205
+ var $;
2206
+ (function ($) {
2207
+ function $mol_log3_area_lazy(event) {
2208
+ const self = this;
2209
+ const stack = self.$mol_log3_stack;
2210
+ const deep = stack.length;
2211
+ let logged = false;
2212
+ stack.push(() => {
2213
+ logged = true;
2214
+ self.$mol_log3_area.call(self, event);
2215
+ });
2216
+ return () => {
2217
+ if (logged)
2218
+ self.console.groupEnd();
2219
+ if (stack.length > deep)
2220
+ stack.length = deep;
2221
+ };
2222
+ }
2223
+ $.$mol_log3_area_lazy = $mol_log3_area_lazy;
2224
+ $.$mol_log3_stack = [];
2225
+ })($ || ($ = {}));
2226
+ //mol/log3/log3.ts
2227
+ ;
2228
+ "use strict";
2229
+ //mol/type/keys/extract/extract.ts
2230
+ ;
2231
+ "use strict";
2232
+ var $;
2233
+ (function ($) {
2234
+ function $mol_log3_web_make(level, color) {
2235
+ return function $mol_log3_logger(event) {
2236
+ const pending = this.$mol_log3_stack.pop();
2237
+ if (pending)
2238
+ pending();
2239
+ let tpl = '%c';
2240
+ const chunks = Object.values(event);
2241
+ for (let i = 0; i < chunks.length; ++i) {
2242
+ tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
2243
+ }
2244
+ const style = `color:${color};font-weight:bolder`;
2245
+ this.console[level](tpl, style, ...chunks);
2246
+ const self = this;
2247
+ return () => self.console.groupEnd();
2248
+ };
2249
+ }
2250
+ $.$mol_log3_web_make = $mol_log3_web_make;
2251
+ $.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
2252
+ $.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
2253
+ $.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
2254
+ $.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
2255
+ $.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
2256
+ $.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
2257
+ })($ || ($ = {}));
2258
+ //mol/log3/log3.web.ts
2259
+ ;
2260
+ "use strict";
2261
+ var $;
2175
2262
  (function ($) {
2176
2263
  class $mol_storage extends $mol_object2 {
2177
2264
  static native() {
2178
2265
  return this.$.$mol_dom_context.navigator.storage;
2179
2266
  }
2180
- static persisted(next) {
2267
+ static persisted(next, cache) {
2181
2268
  $mol_mem_persist();
2269
+ if (cache)
2270
+ return Boolean(next);
2182
2271
  const native = this.native();
2183
- if (next)
2184
- native.persist();
2272
+ if (next && !$mol_mem_cached(() => this.persisted())) {
2273
+ native.persist().then(actual => {
2274
+ setTimeout(() => this.persisted(actual, 'cache'), 5000);
2275
+ if (actual)
2276
+ this.$.$mol_log3_rise({ place: this, message: `Persist` });
2277
+ else
2278
+ this.$.$mol_log3_fail({ place: this, message: `Non persist` });
2279
+ });
2280
+ }
2185
2281
  return next ?? $mol_wire_sync(native).persisted();
2186
2282
  }
2187
2283
  static estimate() {
@@ -3381,62 +3477,6 @@ var $;
3381
3477
  ;
3382
3478
  "use strict";
3383
3479
  var $;
3384
- (function ($) {
3385
- function $mol_log3_area_lazy(event) {
3386
- const self = this;
3387
- const stack = self.$mol_log3_stack;
3388
- const deep = stack.length;
3389
- let logged = false;
3390
- stack.push(() => {
3391
- logged = true;
3392
- self.$mol_log3_area.call(self, event);
3393
- });
3394
- return () => {
3395
- if (logged)
3396
- self.console.groupEnd();
3397
- if (stack.length > deep)
3398
- stack.length = deep;
3399
- };
3400
- }
3401
- $.$mol_log3_area_lazy = $mol_log3_area_lazy;
3402
- $.$mol_log3_stack = [];
3403
- })($ || ($ = {}));
3404
- //mol/log3/log3.ts
3405
- ;
3406
- "use strict";
3407
- //mol/type/keys/extract/extract.ts
3408
- ;
3409
- "use strict";
3410
- var $;
3411
- (function ($) {
3412
- function $mol_log3_web_make(level, color) {
3413
- return function $mol_log3_logger(event) {
3414
- const pending = this.$mol_log3_stack.pop();
3415
- if (pending)
3416
- pending();
3417
- let tpl = '%c';
3418
- const chunks = Object.values(event);
3419
- for (let i = 0; i < chunks.length; ++i) {
3420
- tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
3421
- }
3422
- const style = `color:${color};font-weight:bolder`;
3423
- this.console[level](tpl, style, ...chunks);
3424
- const self = this;
3425
- return () => self.console.groupEnd();
3426
- };
3427
- }
3428
- $.$mol_log3_web_make = $mol_log3_web_make;
3429
- $.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
3430
- $.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
3431
- $.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
3432
- $.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
3433
- $.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
3434
- $.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
3435
- })($ || ($ = {}));
3436
- //mol/log3/log3.web.ts
3437
- ;
3438
- "use strict";
3439
- var $;
3440
3480
  (function ($) {
3441
3481
  $.$hyoo_sync_masters = [
3442
3482
  `sync.hyoo.ru`,
@@ -3952,26 +3992,6 @@ var $;
3952
3992
  ;
3953
3993
  "use strict";
3954
3994
  var $;
3955
- (function ($) {
3956
- function $mol_wire_probe(task, def) {
3957
- const warm = $mol_wire_fiber.warm;
3958
- try {
3959
- $mol_wire_fiber.warm = false;
3960
- const res = task();
3961
- if (res === undefined)
3962
- return def;
3963
- return res;
3964
- }
3965
- finally {
3966
- $mol_wire_fiber.warm = warm;
3967
- }
3968
- }
3969
- $.$mol_wire_probe = $mol_wire_probe;
3970
- })($ || ($ = {}));
3971
- //mol/wire/probe/probe.ts
3972
- ;
3973
- "use strict";
3974
- var $;
3975
3995
  (function ($) {
3976
3996
  class $mol_db_database {
3977
3997
  native;
package/web.test.js CHANGED
@@ -3763,6 +3763,7 @@ var $;
3763
3763
  $mol_assert_equal($mol_key(false), 'false');
3764
3764
  $mol_assert_equal($mol_key(true), 'true');
3765
3765
  $mol_assert_equal($mol_key(0), '0');
3766
+ $mol_assert_equal($mol_key(1n << 64n), '18446744073709551616n');
3766
3767
  $mol_assert_equal($mol_key(''), '""');
3767
3768
  },
3768
3769
  'Array & POJO'() {