mol_mutable 0.0.994 → 0.0.996
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 +1 -0
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js.map +1 -1
- package/node.test.js +23 -21
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -0
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js.map +1 -1
- package/web.test.js +200 -1
- package/web.test.js.map +1 -1
package/node.d.ts
CHANGED
package/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../mam.d.ts","../../type/immutable/deep/deep/deep.d.ts","../mutable.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["../../../mam.d.ts","../../type/immutable/deep/deep/deep.d.ts","../mutable.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null]}
|
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/type/README.md","mol/type/immutable/deep/deep/deep.ts","mol/mutable/README.md","mol/mutable/mutable.ts"],"mods":{},"deps_in":{"mol":{"mol/mutable":-999,"mol/type":-999},"":{"mol":-999},"mol/type/immutable/deep/deep":{"mol/mutable":-2},"mol/type/immutable/deep":{"mol/type/immutable/deep/deep":-999},"mol/type/immutable":{"mol/type/immutable/deep":-999},"mol/type":{"mol/type/immutable":-999}},"deps_out":{"mol/mutable":{"mol":-999,"mol/type/immutable/deep/deep":-2},"mol":{"":-999},"mol/type/immutable/deep/deep":{"mol/type/immutable/deep":-999},"mol/type/immutable/deep":{"mol/type/immutable":-999},"mol/type/immutable":{"mol/type":-999},"mol/type":{"mol":-999}},"sloc":{"ts":
|
|
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/type/README.md","mol/type/immutable/deep/deep/deep.ts","mol/mutable/README.md","mol/mutable/mutable.ts"],"mods":{},"deps_in":{"mol":{"mol/mutable":-999,"mol/type":-999},"":{"mol":-999},"mol/type/immutable/deep/deep":{"mol/mutable":-2},"mol/type/immutable/deep":{"mol/type/immutable/deep/deep":-999},"mol/type/immutable":{"mol/type/immutable/deep":-999},"mol/type":{"mol/type/immutable":-999}},"deps_out":{"mol/mutable":{"mol":-999,"mol/type/immutable/deep/deep":-2},"mol":{"":-999},"mol/type/immutable/deep/deep":{"mol/type/immutable/deep":-999},"mol/type/immutable/deep":{"mol/type/immutable":-999},"mol/type/immutable":{"mol/type":-999},"mol/type":{"mol":-999}},"sloc":{"ts":53,"LICENSE":113,"md":511,"js":9,"json":83,"tree":41,"CNAME":1},"deps":{"mol/mutable":{"..":-999,"/mol/mutable/wrapper":-1,"/mol/type/immutable/deep":-2,"/mol/mutable":-1},"mol":{"..":-999},"":{},"mol/type/immutable/deep/deep":{"..":-999,"/mol/type/immutable/deep":-1},"mol/type/immutable/deep":{"..":-999},"mol/type/immutable":{"..":-999},"mol/type":{"..":-999}}}
|
package/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["-","../../../mam.ts","../../../mol/mutable/mutable.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,
|
|
1
|
+
{"version":3,"sources":["-","../../../mam.ts","../../../mol/mutable/mutable.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAQV;AARD,WAAU,CAAC;AAQX,CAAC,EARS,CAAC,KAAD,CAAC,QAQV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADflB;AACA;AACA;;;;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAwCV;AAxCD,WAAU,CAAC;IAWV,SAAgB,YAAY,CAC3B,KAAY,EACZ,SAAkC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI;QAGtD,IAAI,MAAM,GAAG,SAA8B,CAAA;QAE3C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAE,KAAK,CAAE;YACnC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAE,GAAI,KAAY,CAAW;YACpC,CAAC,CAAC,GAAE,EAAE,CAAC,CAAC,EAAE,GAAI,KAAK,EAAE,CAAC,CAAA;QAEvB,OAAO,IAAI,KAAK,CAAE,YAAY,EAAE;YAE/B,GAAG,EAAE,CAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CACxB,KAAK,CAAE,KAAoB,CAAE,EAC7B,IAAI,CAAC,EAAE,CAAC,CAAE,MAAM,IAAI,CAAE,MAAM,GAAG,MAAM,CAAE,KAAK,EAAE,CAAE,CAAE,CAAE,CAAE,KAAoB,CAAE,GAAG,IAAI,CACnF;YAED,GAAG,EAAE,GAAE,EAAE,CAAC,KAAK;YAEf,KAAK,EAAE,CAAE,GAAG,EAAE,IAAI,EAAE,CAAE,KAAK,CAAE,EAAE,EAAE;gBAChC,IAAI,KAAK;oBAAG,MAAM,CAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAE,KAAK,CAAE,CAAE,CAAA;gBACrD,OAAO,MAAM,IAAI,KAAK,CAAA;YACvB,CAAC;SAED,CAAS,CAAA;IAEX,CAAC;IA3Be,cAAY,eA2B3B,CAAA;AAEF,CAAC,EAxCS,CAAC,KAAD,CAAC,QAwCV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {\n\t\tstatic $: $\n\t}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\texport type $mol_mutable_wrapper< Value > = {\n\t\t(\n\t\t\tpatch?: ( next: $mol_type_immutable_deep< Value > )=> $mol_type_immutable_deep< Value >\n\t\t): $mol_type_immutable_deep< Value >\n\t} & {\n\t\t[ Field in keyof Value ]: $mol_mutable_wrapper< Value[ Field ] >\n\t}\n\t\n\t/** Mutable way for immutable patch */\n\texport function $mol_mutable< Value >(\n\t\tinput: Value,\n\t\tupdate: ( next: Value )=> Value = next => input = next,\n\t): $mol_mutable_wrapper< Value > {\n\t\t\n\t\tlet output = undefined as undefined | Value\n\t\t\n\t\tconst clone = Array.isArray( input )\n\t\t\t? ()=> [ ... input as any ] as Value\n\t\t\t: ()=> ({ ... input })\n\t\t\n\t\treturn new Proxy( $mol_mutable, {\n\t\t\t\n\t\t\tget: ( Mut, field )=> Mut(\n\t\t\t\tinput[ field as keyof Value ],\n\t\t\t\tnext => ( output ?? ( output = update( clone() ) ) )[ field as keyof Value ] = next,\n\t\t\t),\n\t\t\t\n\t\t\tset: ()=> false,\n\t\t\t\n\t\t\tapply: ( Mut, self, [ patch ] )=> {\n\t\t\t\tif( patch ) update( output = input = patch( input ) )\n\t\t\t\treturn output ?? input\n\t\t\t},\n\t\t\t\n\t\t} ) as any\n\t\t\n\t}\n\t\n}\n"]}
|
package/node.test.js
CHANGED
|
@@ -751,11 +751,11 @@ var $;
|
|
|
751
751
|
function $mol_dev_format_button(label, click) {
|
|
752
752
|
return $mol_dev_format_auto({
|
|
753
753
|
[$.$mol_dev_format_head]() {
|
|
754
|
-
return
|
|
754
|
+
return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
|
|
755
755
|
},
|
|
756
756
|
[$.$mol_dev_format_body]() {
|
|
757
757
|
Promise.resolve().then(click);
|
|
758
|
-
return
|
|
758
|
+
return $.$mol_dev_format_span({});
|
|
759
759
|
}
|
|
760
760
|
});
|
|
761
761
|
}
|
|
@@ -776,8 +776,8 @@ var $;
|
|
|
776
776
|
if (typeof val === 'function') {
|
|
777
777
|
return $mol_dev_format_native(val);
|
|
778
778
|
}
|
|
779
|
-
if (Error
|
|
780
|
-
return
|
|
779
|
+
if (val instanceof Error) {
|
|
780
|
+
return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
|
|
781
781
|
}
|
|
782
782
|
if (val instanceof Promise) {
|
|
783
783
|
return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
|
|
@@ -849,28 +849,23 @@ var $;
|
|
|
849
849
|
];
|
|
850
850
|
}
|
|
851
851
|
$.$mol_dev_format_element = $mol_dev_format_element;
|
|
852
|
-
|
|
853
|
-
return $mol_dev_format_element('span', {
|
|
854
|
-
...style,
|
|
855
|
-
}, ...content);
|
|
856
|
-
}
|
|
857
|
-
$.$mol_dev_format_span = $mol_dev_format_span;
|
|
852
|
+
$.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
|
|
858
853
|
$.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
|
|
859
854
|
$.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
|
|
860
855
|
$.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
|
|
861
856
|
$.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
|
|
862
857
|
$.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
|
|
863
858
|
$.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
|
|
864
|
-
$.$mol_dev_format_accent =
|
|
859
|
+
$.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
|
|
865
860
|
'color': 'magenta',
|
|
866
861
|
});
|
|
867
|
-
$.$mol_dev_format_strong =
|
|
862
|
+
$.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
|
|
868
863
|
'font-weight': 'bold',
|
|
869
864
|
});
|
|
870
|
-
$.$mol_dev_format_string =
|
|
865
|
+
$.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
|
|
871
866
|
'color': 'green',
|
|
872
867
|
});
|
|
873
|
-
$.$mol_dev_format_shade =
|
|
868
|
+
$.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
|
|
874
869
|
'color': 'gray',
|
|
875
870
|
});
|
|
876
871
|
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
@@ -1549,7 +1544,7 @@ var $;
|
|
|
1549
1544
|
var $;
|
|
1550
1545
|
(function ($) {
|
|
1551
1546
|
function $mol_log3_area_lazy(event) {
|
|
1552
|
-
const self = this
|
|
1547
|
+
const self = this.$;
|
|
1553
1548
|
const stack = self.$mol_log3_stack;
|
|
1554
1549
|
const deep = stack.length;
|
|
1555
1550
|
let logged = false;
|
|
@@ -1662,15 +1657,22 @@ var $;
|
|
|
1662
1657
|
return function $mol_wire_task_get(host, args) {
|
|
1663
1658
|
const sub = $mol_wire_auto();
|
|
1664
1659
|
const existen = sub?.track_next();
|
|
1660
|
+
let cause = '';
|
|
1665
1661
|
reuse: if (existen) {
|
|
1666
1662
|
if (!existen.temp)
|
|
1667
1663
|
break reuse;
|
|
1668
|
-
if (existen.
|
|
1664
|
+
if (existen.task !== task) {
|
|
1665
|
+
cause = 'task';
|
|
1669
1666
|
break reuse;
|
|
1670
|
-
|
|
1667
|
+
}
|
|
1668
|
+
if (existen.host !== host) {
|
|
1669
|
+
cause = 'host';
|
|
1671
1670
|
break reuse;
|
|
1672
|
-
|
|
1671
|
+
}
|
|
1672
|
+
if (!$mol_compare_deep(existen.args, args)) {
|
|
1673
|
+
cause = 'args';
|
|
1673
1674
|
break reuse;
|
|
1675
|
+
}
|
|
1674
1676
|
return existen;
|
|
1675
1677
|
}
|
|
1676
1678
|
const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
|
|
@@ -1678,11 +1680,11 @@ var $;
|
|
|
1678
1680
|
if (existen?.temp) {
|
|
1679
1681
|
$$.$mol_log3_warn({
|
|
1680
1682
|
place: '$mol_wire_task',
|
|
1681
|
-
message: `
|
|
1683
|
+
message: `Different ${cause} on restart`,
|
|
1682
1684
|
sub,
|
|
1683
|
-
|
|
1685
|
+
prev: existen,
|
|
1684
1686
|
next,
|
|
1685
|
-
hint: '
|
|
1687
|
+
hint: 'Maybe required additional memoization',
|
|
1686
1688
|
});
|
|
1687
1689
|
}
|
|
1688
1690
|
return next;
|