hyoo_sync_client 0.0.232 → 0.0.234
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.d.ts +9 -0
- package/node.deps.json +1 -1
- package/node.js +38 -2
- package/node.js.map +1 -1
- package/node.mjs +38 -2
- package/node.test.js +38 -2
- package/node.test.js.map +1 -1
- package/package.json +2 -1
- package/web.d.ts +30 -8
- package/web.deps.json +1 -1
- package/web.js +93 -38
- package/web.js.map +1 -1
- package/web.mjs +93 -38
package/node.mjs
CHANGED
|
@@ -2560,6 +2560,33 @@ var $;
|
|
|
2560
2560
|
;
|
|
2561
2561
|
"use strict";
|
|
2562
2562
|
var $;
|
|
2563
|
+
(function ($) {
|
|
2564
|
+
class $mol_storage extends $mol_object2 {
|
|
2565
|
+
static native() {
|
|
2566
|
+
return null;
|
|
2567
|
+
}
|
|
2568
|
+
static persisted(next) {
|
|
2569
|
+
return false;
|
|
2570
|
+
}
|
|
2571
|
+
static estimate() {
|
|
2572
|
+
return 0;
|
|
2573
|
+
}
|
|
2574
|
+
static dir() {
|
|
2575
|
+
return null;
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
__decorate([
|
|
2579
|
+
$mol_mem
|
|
2580
|
+
], $mol_storage, "native", null);
|
|
2581
|
+
__decorate([
|
|
2582
|
+
$mol_mem
|
|
2583
|
+
], $mol_storage, "persisted", null);
|
|
2584
|
+
$.$mol_storage = $mol_storage;
|
|
2585
|
+
})($ || ($ = {}));
|
|
2586
|
+
//mol/storage/storage.node.ts
|
|
2587
|
+
;
|
|
2588
|
+
"use strict";
|
|
2589
|
+
var $;
|
|
2563
2590
|
(function ($) {
|
|
2564
2591
|
class $mol_state_local extends $mol_object {
|
|
2565
2592
|
static 'native()';
|
|
@@ -2594,10 +2621,18 @@ var $;
|
|
|
2594
2621
|
this.changes();
|
|
2595
2622
|
if (next === void 0)
|
|
2596
2623
|
return JSON.parse(this.native().getItem(key) || 'null');
|
|
2597
|
-
if (next === null)
|
|
2624
|
+
if (next === null) {
|
|
2598
2625
|
this.native().removeItem(key);
|
|
2599
|
-
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2600
2628
|
this.native().setItem(key, JSON.stringify(next));
|
|
2629
|
+
try {
|
|
2630
|
+
this.$.$mol_storage.persisted(true);
|
|
2631
|
+
}
|
|
2632
|
+
catch (error) {
|
|
2633
|
+
$mol_fail_log(error);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2601
2636
|
return next;
|
|
2602
2637
|
}
|
|
2603
2638
|
prefix() { return ''; }
|
|
@@ -4372,6 +4407,7 @@ var $;
|
|
|
4372
4407
|
Unit.put(unit, [unit.land, unit.head, unit.self]);
|
|
4373
4408
|
}
|
|
4374
4409
|
await trans.commit();
|
|
4410
|
+
this.$.$mol_storage.native().persist();
|
|
4375
4411
|
}
|
|
4376
4412
|
reconnects(reset) {
|
|
4377
4413
|
return ($mol_wire_probe(() => this.reconnects()) ?? 0) + 1;
|
package/node.test.js
CHANGED
|
@@ -2552,6 +2552,33 @@ var $;
|
|
|
2552
2552
|
;
|
|
2553
2553
|
"use strict";
|
|
2554
2554
|
var $;
|
|
2555
|
+
(function ($) {
|
|
2556
|
+
class $mol_storage extends $mol_object2 {
|
|
2557
|
+
static native() {
|
|
2558
|
+
return null;
|
|
2559
|
+
}
|
|
2560
|
+
static persisted(next) {
|
|
2561
|
+
return false;
|
|
2562
|
+
}
|
|
2563
|
+
static estimate() {
|
|
2564
|
+
return 0;
|
|
2565
|
+
}
|
|
2566
|
+
static dir() {
|
|
2567
|
+
return null;
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
__decorate([
|
|
2571
|
+
$mol_mem
|
|
2572
|
+
], $mol_storage, "native", null);
|
|
2573
|
+
__decorate([
|
|
2574
|
+
$mol_mem
|
|
2575
|
+
], $mol_storage, "persisted", null);
|
|
2576
|
+
$.$mol_storage = $mol_storage;
|
|
2577
|
+
})($ || ($ = {}));
|
|
2578
|
+
//mol/storage/storage.node.ts
|
|
2579
|
+
;
|
|
2580
|
+
"use strict";
|
|
2581
|
+
var $;
|
|
2555
2582
|
(function ($) {
|
|
2556
2583
|
class $mol_state_local extends $mol_object {
|
|
2557
2584
|
static 'native()';
|
|
@@ -2586,10 +2613,18 @@ var $;
|
|
|
2586
2613
|
this.changes();
|
|
2587
2614
|
if (next === void 0)
|
|
2588
2615
|
return JSON.parse(this.native().getItem(key) || 'null');
|
|
2589
|
-
if (next === null)
|
|
2616
|
+
if (next === null) {
|
|
2590
2617
|
this.native().removeItem(key);
|
|
2591
|
-
|
|
2618
|
+
}
|
|
2619
|
+
else {
|
|
2592
2620
|
this.native().setItem(key, JSON.stringify(next));
|
|
2621
|
+
try {
|
|
2622
|
+
this.$.$mol_storage.persisted(true);
|
|
2623
|
+
}
|
|
2624
|
+
catch (error) {
|
|
2625
|
+
$mol_fail_log(error);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2593
2628
|
return next;
|
|
2594
2629
|
}
|
|
2595
2630
|
prefix() { return ''; }
|
|
@@ -4364,6 +4399,7 @@ var $;
|
|
|
4364
4399
|
Unit.put(unit, [unit.land, unit.head, unit.self]);
|
|
4365
4400
|
}
|
|
4366
4401
|
await trans.commit();
|
|
4402
|
+
this.$.$mol_storage.native().persist();
|
|
4367
4403
|
}
|
|
4368
4404
|
reconnects(reset) {
|
|
4369
4405
|
return ($mol_wire_probe(() => this.reconnects()) ?? 0) + 1;
|