mol_dump_lib 0.0.166 → 0.0.168
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 -4
- package/node.deps.json +1 -1
- package/node.js +34 -8
- package/node.js.map +1 -1
- package/node.mjs +34 -8
- package/node.test.js +34 -8
- package/node.test.js.map +1 -1
- package/package.json +2 -1
- package/web.d.ts +2 -1
- package/web.deps.json +1 -1
- package/web.js +11 -5
- package/web.js.map +1 -1
- package/web.mjs +11 -5
package/node.js
CHANGED
|
@@ -84,7 +84,7 @@ var $;
|
|
|
84
84
|
try {
|
|
85
85
|
if (!having)
|
|
86
86
|
return false;
|
|
87
|
-
if (typeof having !== 'object')
|
|
87
|
+
if (typeof having !== 'object' && typeof having !== 'function')
|
|
88
88
|
return false;
|
|
89
89
|
if (having instanceof $mol_delegate)
|
|
90
90
|
return false;
|
|
@@ -220,11 +220,12 @@ var $;
|
|
|
220
220
|
return this.name;
|
|
221
221
|
}
|
|
222
222
|
destructor() { }
|
|
223
|
+
static destructor() { }
|
|
223
224
|
toString() {
|
|
224
225
|
return this[Symbol.toStringTag] || this.constructor.name + '()';
|
|
225
226
|
}
|
|
226
227
|
static toJSON() {
|
|
227
|
-
return this.$.$mol_func_name(this);
|
|
228
|
+
return this[Symbol.toStringTag] || this.$.$mol_func_name(this);
|
|
228
229
|
}
|
|
229
230
|
toJSON() {
|
|
230
231
|
return this.toString();
|
|
@@ -5131,19 +5132,44 @@ var $;
|
|
|
5131
5132
|
;
|
|
5132
5133
|
"use strict";
|
|
5133
5134
|
var $;
|
|
5135
|
+
(function ($) {
|
|
5136
|
+
$.$mol_mem_persist = $mol_wire_solid;
|
|
5137
|
+
})($ || ($ = {}));
|
|
5138
|
+
//mol/mem/persist/persist.ts
|
|
5139
|
+
;
|
|
5140
|
+
"use strict";
|
|
5141
|
+
var $;
|
|
5134
5142
|
(function ($) {
|
|
5135
5143
|
class $mol_storage extends $mol_object2 {
|
|
5136
5144
|
static native() {
|
|
5137
|
-
return
|
|
5145
|
+
return this.$.$mol_dom_context.navigator.storage ?? {
|
|
5146
|
+
persisted: async () => false,
|
|
5147
|
+
persist: async () => false,
|
|
5148
|
+
estimate: async () => ({}),
|
|
5149
|
+
getDirectory: async () => null,
|
|
5150
|
+
};
|
|
5138
5151
|
}
|
|
5139
|
-
static persisted(next) {
|
|
5140
|
-
|
|
5152
|
+
static persisted(next, cache) {
|
|
5153
|
+
$mol_mem_persist();
|
|
5154
|
+
if (cache)
|
|
5155
|
+
return Boolean(next);
|
|
5156
|
+
const native = this.native();
|
|
5157
|
+
if (next && !$mol_mem_cached(() => this.persisted())) {
|
|
5158
|
+
native.persist().then(actual => {
|
|
5159
|
+
setTimeout(() => this.persisted(actual, 'cache'), 5000);
|
|
5160
|
+
if (actual)
|
|
5161
|
+
this.$.$mol_log3_rise({ place: `$mol_storage`, message: `Persist: Yes` });
|
|
5162
|
+
else
|
|
5163
|
+
this.$.$mol_log3_fail({ place: `$mol_storage`, message: `Persist: No` });
|
|
5164
|
+
});
|
|
5165
|
+
}
|
|
5166
|
+
return next ?? $mol_wire_sync(native).persisted();
|
|
5141
5167
|
}
|
|
5142
5168
|
static estimate() {
|
|
5143
|
-
return
|
|
5169
|
+
return $mol_wire_sync(this.native() ?? {}).estimate();
|
|
5144
5170
|
}
|
|
5145
5171
|
static dir() {
|
|
5146
|
-
return
|
|
5172
|
+
return $mol_wire_sync(this.native()).getDirectory();
|
|
5147
5173
|
}
|
|
5148
5174
|
}
|
|
5149
5175
|
__decorate([
|
|
@@ -5154,7 +5180,7 @@ var $;
|
|
|
5154
5180
|
], $mol_storage, "persisted", null);
|
|
5155
5181
|
$.$mol_storage = $mol_storage;
|
|
5156
5182
|
})($ || ($ = {}));
|
|
5157
|
-
//mol/storage/storage.
|
|
5183
|
+
//mol/storage/storage.ts
|
|
5158
5184
|
;
|
|
5159
5185
|
"use strict";
|
|
5160
5186
|
var $;
|