mol_mutable 0.0.1219 → 0.0.1220
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 +6 -0
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +1 -0
- package/node.js.map +1 -1
- package/node.mjs +1 -0
- package/node.test.js +247 -9
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +6 -0
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +1 -0
- package/web.js.map +1 -1
- package/web.mjs +1 -0
- package/web.test.js +67 -1
- package/web.test.js.map +1 -1
package/package.json
CHANGED
package/web.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ declare namespace $ {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
declare namespace $ {
|
|
18
|
+
/**
|
|
19
|
+
* Recursive `Readonly`.
|
|
20
|
+
*
|
|
21
|
+
* let props : $mol_type_immutable_deep< { foo: number[] } > = { readonly foo: readonly number[] }
|
|
22
|
+
*/
|
|
18
23
|
type $mol_type_immutable_deep<Val> = {
|
|
19
24
|
readonly [field in keyof Val]: $mol_type_immutable_deep<Val[field]>;
|
|
20
25
|
};
|
|
@@ -26,6 +31,7 @@ declare namespace $ {
|
|
|
26
31
|
} & {
|
|
27
32
|
[Field in keyof Value]: $mol_mutable_wrapper<Value[Field]>;
|
|
28
33
|
};
|
|
34
|
+
/** Mutable way for immutable patch */
|
|
29
35
|
function $mol_mutable<Value>(input: Value, update?: (next: Value) => Value): $mol_mutable_wrapper<Value>;
|
|
30
36
|
}
|
|
31
37
|
|
package/web.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;AACA;ACfA;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;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null]}
|
package/web.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":53,"LICENSE":113,"md":
|
|
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":570,"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/web.js
CHANGED
package/web.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,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;
|
|
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;IAUV,sCAAsC;IACtC,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/web.mjs
CHANGED
package/web.test.js
CHANGED
|
@@ -47,7 +47,7 @@ var $;
|
|
|
47
47
|
var $;
|
|
48
48
|
(function ($) {
|
|
49
49
|
function $mol_fail_hidden(error) {
|
|
50
|
-
throw error;
|
|
50
|
+
throw error; /// Use 'Never Pause Here' breakpoint in DevTools or simply blackbox this script
|
|
51
51
|
}
|
|
52
52
|
$.$mol_fail_hidden = $mol_fail_hidden;
|
|
53
53
|
})($ || ($ = {}));
|
|
@@ -253,6 +253,12 @@ var $;
|
|
|
253
253
|
createDocumentFragment: () => $mol_dom_context.document.createDocumentFragment(),
|
|
254
254
|
};
|
|
255
255
|
$.$mol_jsx_frag = '';
|
|
256
|
+
/**
|
|
257
|
+
* JSX adapter that makes DOM tree.
|
|
258
|
+
* Generates global unique ids for every DOM-element by components tree with ids.
|
|
259
|
+
* Ensures all local ids are unique.
|
|
260
|
+
* Can reuse an existing nodes by GUIDs when used inside [`mol_jsx_attach`](https://github.com/hyoo-ru/mam_mol/tree/master/jsx/attach).
|
|
261
|
+
*/
|
|
256
262
|
function $mol_jsx(Elem, props, ...childNodes) {
|
|
257
263
|
const id = props && props.id || '';
|
|
258
264
|
const guid = id ? $.$mol_jsx_prefix ? $.$mol_jsx_prefix + '/' + id : id : $.$mol_jsx_prefix;
|
|
@@ -363,6 +369,8 @@ var $;
|
|
|
363
369
|
|
|
364
370
|
;
|
|
365
371
|
"use strict";
|
|
372
|
+
/** @jsx $mol_jsx */
|
|
373
|
+
/** @jsxFrag $mol_jsx_frag */
|
|
366
374
|
var $;
|
|
367
375
|
(function ($) {
|
|
368
376
|
$mol_test({
|
|
@@ -468,6 +476,7 @@ var $;
|
|
|
468
476
|
"use strict";
|
|
469
477
|
var $;
|
|
470
478
|
(function ($) {
|
|
479
|
+
/** Generates unique identifier. */
|
|
471
480
|
function $mol_guid(length = 8, exists = () => false) {
|
|
472
481
|
for (;;) {
|
|
473
482
|
let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
|
|
@@ -483,6 +492,7 @@ var $;
|
|
|
483
492
|
"use strict";
|
|
484
493
|
var $;
|
|
485
494
|
(function ($) {
|
|
495
|
+
/** Lazy computed lists with native Array interface. $mol_range2_array is mutable but all derived ranges are immutable. */
|
|
486
496
|
function $mol_range2(item = index => index, size = () => Number.POSITIVE_INFINITY) {
|
|
487
497
|
const source = typeof item === 'function' ? new $mol_range2_array() : item;
|
|
488
498
|
if (typeof item !== 'function') {
|
|
@@ -531,6 +541,7 @@ var $;
|
|
|
531
541
|
}
|
|
532
542
|
$.$mol_range2 = $mol_range2;
|
|
533
543
|
class $mol_range2_array extends Array {
|
|
544
|
+
// Lazy
|
|
534
545
|
concat(...tail) {
|
|
535
546
|
if (tail.length === 0)
|
|
536
547
|
return this;
|
|
@@ -542,6 +553,7 @@ var $;
|
|
|
542
553
|
}
|
|
543
554
|
return $mol_range2(index => index < this.length ? this[index] : tail[0][index - this.length], () => this.length + tail[0].length);
|
|
544
555
|
}
|
|
556
|
+
// Lazy
|
|
545
557
|
filter(check, context) {
|
|
546
558
|
const filtered = [];
|
|
547
559
|
let cursor = -1;
|
|
@@ -554,13 +566,16 @@ var $;
|
|
|
554
566
|
return filtered[index];
|
|
555
567
|
}, () => cursor < this.length ? Number.POSITIVE_INFINITY : filtered.length);
|
|
556
568
|
}
|
|
569
|
+
// Diligent
|
|
557
570
|
forEach(proceed, context) {
|
|
558
571
|
for (let [key, value] of this.entries())
|
|
559
572
|
proceed.call(context, value, key, this);
|
|
560
573
|
}
|
|
574
|
+
// Lazy
|
|
561
575
|
map(proceed, context) {
|
|
562
576
|
return $mol_range2(index => proceed.call(context, this[index], index, this), () => this.length);
|
|
563
577
|
}
|
|
578
|
+
// Diligent
|
|
564
579
|
reduce(merge, result) {
|
|
565
580
|
let index = 0;
|
|
566
581
|
if (arguments.length === 1) {
|
|
@@ -571,12 +586,15 @@ var $;
|
|
|
571
586
|
}
|
|
572
587
|
return result;
|
|
573
588
|
}
|
|
589
|
+
// Lazy
|
|
574
590
|
toReversed() {
|
|
575
591
|
return $mol_range2(index => this[this.length - 1 - index], () => this.length);
|
|
576
592
|
}
|
|
593
|
+
// Lazy
|
|
577
594
|
slice(from = 0, to = this.length) {
|
|
578
595
|
return $mol_range2(index => this[from + index], () => Math.min(to, this.length) - from);
|
|
579
596
|
}
|
|
597
|
+
// Lazy
|
|
580
598
|
some(check, context) {
|
|
581
599
|
for (let index = 0; index < this.length; ++index) {
|
|
582
600
|
if (check.call(context, this[index], index, this))
|
|
@@ -772,6 +790,10 @@ var $;
|
|
|
772
790
|
var $;
|
|
773
791
|
(function ($) {
|
|
774
792
|
$.$mol_compare_deep_cache = new WeakMap();
|
|
793
|
+
/**
|
|
794
|
+
* Deeply compares two values. Returns true if equal.
|
|
795
|
+
* Define `Symbol.toPrimitive` to customize.
|
|
796
|
+
*/
|
|
775
797
|
function $mol_compare_deep(left, right) {
|
|
776
798
|
if (Object.is(left, right))
|
|
777
799
|
return true;
|
|
@@ -909,6 +931,7 @@ var $;
|
|
|
909
931
|
|
|
910
932
|
;
|
|
911
933
|
"use strict";
|
|
934
|
+
/** @jsx $mol_jsx */
|
|
912
935
|
var $;
|
|
913
936
|
(function ($) {
|
|
914
937
|
$mol_test({
|
|
@@ -970,6 +993,7 @@ var $;
|
|
|
970
993
|
const obj3_copy = { test: 3, obj2: obj2_copy };
|
|
971
994
|
obj1.obj3 = obj3;
|
|
972
995
|
obj1_copy.obj3 = obj3_copy;
|
|
996
|
+
// warmup cache
|
|
973
997
|
$mol_assert_not($mol_compare_deep(obj1, {}));
|
|
974
998
|
$mol_assert_not($mol_compare_deep(obj2, {}));
|
|
975
999
|
$mol_assert_not($mol_compare_deep(obj3, {}));
|
|
@@ -1039,6 +1063,7 @@ var $;
|
|
|
1039
1063
|
"use strict";
|
|
1040
1064
|
var $;
|
|
1041
1065
|
(function ($) {
|
|
1066
|
+
// https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview#
|
|
1042
1067
|
$['devtoolsFormatters'] ||= [];
|
|
1043
1068
|
function $mol_dev_format_register(config) {
|
|
1044
1069
|
$['devtoolsFormatters'].push(config);
|
|
@@ -1090,6 +1115,7 @@ var $;
|
|
|
1090
1115
|
return false;
|
|
1091
1116
|
if (!val)
|
|
1092
1117
|
return false;
|
|
1118
|
+
// if( Error.isError( val ) ) true
|
|
1093
1119
|
if (val[$.$mol_dev_format_body])
|
|
1094
1120
|
return true;
|
|
1095
1121
|
return false;
|
|
@@ -1107,12 +1133,16 @@ var $;
|
|
|
1107
1133
|
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
1108
1134
|
}
|
|
1109
1135
|
}
|
|
1136
|
+
// if( Error.isError( val ) ) {
|
|
1137
|
+
// return $mol_dev_format_native( val )
|
|
1138
|
+
// }
|
|
1110
1139
|
return null;
|
|
1111
1140
|
},
|
|
1112
1141
|
});
|
|
1113
1142
|
function $mol_dev_format_native(obj) {
|
|
1114
1143
|
if (typeof obj === 'undefined')
|
|
1115
1144
|
return $.$mol_dev_format_shade('undefined');
|
|
1145
|
+
// if( ![ 'object', 'function', 'symbol' ].includes( typeof obj ) ) return obj
|
|
1116
1146
|
return [
|
|
1117
1147
|
'object',
|
|
1118
1148
|
{
|
|
@@ -1170,6 +1200,9 @@ var $;
|
|
|
1170
1200
|
'margin-left': '13px'
|
|
1171
1201
|
});
|
|
1172
1202
|
class Stack extends Array {
|
|
1203
|
+
// [ Symbol.toPrimitive ]() {
|
|
1204
|
+
// return this.toString()
|
|
1205
|
+
// }
|
|
1173
1206
|
toString() {
|
|
1174
1207
|
return this.join('\n');
|
|
1175
1208
|
}
|
|
@@ -1192,6 +1225,7 @@ var $;
|
|
|
1192
1225
|
this.method = call.getMethodName() ?? '';
|
|
1193
1226
|
if (this.method === this.function)
|
|
1194
1227
|
this.method = '';
|
|
1228
|
+
// const func = c.getFunction()
|
|
1195
1229
|
this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
|
|
1196
1230
|
this.eval = call.getEvalOrigin() ?? '';
|
|
1197
1231
|
this.source = call.getScriptNameOrSourceURL() ?? '';
|
|
@@ -1238,18 +1272,34 @@ var $;
|
|
|
1238
1272
|
"use strict";
|
|
1239
1273
|
var $;
|
|
1240
1274
|
(function ($) {
|
|
1275
|
+
/**
|
|
1276
|
+
* Argument must be Truthy
|
|
1277
|
+
* @deprecated use $mol_assert_equal instead
|
|
1278
|
+
*/
|
|
1241
1279
|
function $mol_assert_ok(value) {
|
|
1242
1280
|
if (value)
|
|
1243
1281
|
return;
|
|
1244
1282
|
$mol_fail(new Error(`${value} ≠ true`));
|
|
1245
1283
|
}
|
|
1246
1284
|
$.$mol_assert_ok = $mol_assert_ok;
|
|
1285
|
+
/**
|
|
1286
|
+
* Argument must be Falsy
|
|
1287
|
+
* @deprecated use $mol_assert_equal instead
|
|
1288
|
+
*/
|
|
1247
1289
|
function $mol_assert_not(value) {
|
|
1248
1290
|
if (!value)
|
|
1249
1291
|
return;
|
|
1250
1292
|
$mol_fail(new Error(`${value} ≠ false`));
|
|
1251
1293
|
}
|
|
1252
1294
|
$.$mol_assert_not = $mol_assert_not;
|
|
1295
|
+
/**
|
|
1296
|
+
* Handler must throw an error.
|
|
1297
|
+
* @example
|
|
1298
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } ) // Passes because throws error
|
|
1299
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } , 'Parse error' ) // Passes because throws right message
|
|
1300
|
+
* $mol_assert_fail( ()=>{ throw new Error( 'Parse error' ) } , Error ) // Passes because throws right class
|
|
1301
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
1302
|
+
*/
|
|
1253
1303
|
function $mol_assert_fail(handler, ErrorRight) {
|
|
1254
1304
|
const fail = $.$mol_fail;
|
|
1255
1305
|
try {
|
|
@@ -1272,10 +1322,18 @@ var $;
|
|
|
1272
1322
|
$mol_fail(new Error('Not failed', { cause: { expect: ErrorRight } }));
|
|
1273
1323
|
}
|
|
1274
1324
|
$.$mol_assert_fail = $mol_assert_fail;
|
|
1325
|
+
/** @deprecated Use $mol_assert_equal */
|
|
1275
1326
|
function $mol_assert_like(...args) {
|
|
1276
1327
|
$mol_assert_equal(...args);
|
|
1277
1328
|
}
|
|
1278
1329
|
$.$mol_assert_like = $mol_assert_like;
|
|
1330
|
+
/**
|
|
1331
|
+
* All arguments must not be structural equal to each other.
|
|
1332
|
+
* @example
|
|
1333
|
+
* $mol_assert_unique( 1 , 2 , 3 ) // Passes
|
|
1334
|
+
* $mol_assert_unique( 1 , 1 , 2 ) // Fails because 1 === 1
|
|
1335
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
1336
|
+
*/
|
|
1279
1337
|
function $mol_assert_unique(...args) {
|
|
1280
1338
|
for (let i = 0; i < args.length; ++i) {
|
|
1281
1339
|
for (let j = 0; j < args.length; ++j) {
|
|
@@ -1288,6 +1346,13 @@ var $;
|
|
|
1288
1346
|
}
|
|
1289
1347
|
}
|
|
1290
1348
|
$.$mol_assert_unique = $mol_assert_unique;
|
|
1349
|
+
/**
|
|
1350
|
+
* All arguments must be structural equal each other.
|
|
1351
|
+
* @example
|
|
1352
|
+
* $mol_assert_like( [1] , [1] , [1] ) // Passes
|
|
1353
|
+
* $mol_assert_like( [1] , [1] , [2] ) // Fails because 1 !== 2
|
|
1354
|
+
* @see https://mol.hyoo.ru/#!section=docs/=9q9dv3_fgxjsf
|
|
1355
|
+
*/
|
|
1291
1356
|
function $mol_assert_equal(...args) {
|
|
1292
1357
|
for (let i = 1; i < args.length; ++i) {
|
|
1293
1358
|
if ($mol_compare_deep(args[0], args[i]))
|
|
@@ -1340,6 +1405,7 @@ var $;
|
|
|
1340
1405
|
"use strict";
|
|
1341
1406
|
var $;
|
|
1342
1407
|
(function ($) {
|
|
1408
|
+
/** Log begin of collapsed group only when some logged inside, returns func to close group */
|
|
1343
1409
|
function $mol_log3_area_lazy(event) {
|
|
1344
1410
|
const self = this.$;
|
|
1345
1411
|
const stack = self.$mol_log3_stack;
|