mol_data_all 1.1.918 → 1.1.920
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.test.js +49 -46
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -1842,6 +1842,9 @@ var $;
|
|
|
1842
1842
|
toString() {
|
|
1843
1843
|
return this[Symbol.toStringTag] || this.constructor.name + '()';
|
|
1844
1844
|
}
|
|
1845
|
+
static toJSON() {
|
|
1846
|
+
return this.$.$mol_func_name(this);
|
|
1847
|
+
}
|
|
1845
1848
|
toJSON() {
|
|
1846
1849
|
return this.toString();
|
|
1847
1850
|
}
|
|
@@ -1852,6 +1855,52 @@ var $;
|
|
|
1852
1855
|
;
|
|
1853
1856
|
"use strict";
|
|
1854
1857
|
var $;
|
|
1858
|
+
(function ($) {
|
|
1859
|
+
const named = new WeakSet();
|
|
1860
|
+
function $mol_func_name(func) {
|
|
1861
|
+
let name = func.name;
|
|
1862
|
+
if (name?.length > 1)
|
|
1863
|
+
return name;
|
|
1864
|
+
if (named.has(func))
|
|
1865
|
+
return name;
|
|
1866
|
+
for (let key in this) {
|
|
1867
|
+
try {
|
|
1868
|
+
if (this[key] !== func)
|
|
1869
|
+
continue;
|
|
1870
|
+
name = key;
|
|
1871
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
1872
|
+
break;
|
|
1873
|
+
}
|
|
1874
|
+
catch { }
|
|
1875
|
+
}
|
|
1876
|
+
named.add(func);
|
|
1877
|
+
return name;
|
|
1878
|
+
}
|
|
1879
|
+
$.$mol_func_name = $mol_func_name;
|
|
1880
|
+
function $mol_func_name_from(target, source) {
|
|
1881
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
1882
|
+
return target;
|
|
1883
|
+
}
|
|
1884
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
1885
|
+
})($ || ($ = {}));
|
|
1886
|
+
//mol/func/name/name.ts
|
|
1887
|
+
;
|
|
1888
|
+
"use strict";
|
|
1889
|
+
var $;
|
|
1890
|
+
(function ($_1) {
|
|
1891
|
+
$mol_test({
|
|
1892
|
+
'FQN of anon function'($) {
|
|
1893
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
1894
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
1895
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
1896
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
1897
|
+
},
|
|
1898
|
+
});
|
|
1899
|
+
})($ || ($ = {}));
|
|
1900
|
+
//mol/func/name/name.test.ts
|
|
1901
|
+
;
|
|
1902
|
+
"use strict";
|
|
1903
|
+
var $;
|
|
1855
1904
|
(function ($) {
|
|
1856
1905
|
const instances = new WeakSet();
|
|
1857
1906
|
function $mol_delegate(proto, target) {
|
|
@@ -2551,52 +2600,6 @@ var $;
|
|
|
2551
2600
|
;
|
|
2552
2601
|
"use strict";
|
|
2553
2602
|
var $;
|
|
2554
|
-
(function ($) {
|
|
2555
|
-
const named = new WeakSet();
|
|
2556
|
-
function $mol_func_name(func) {
|
|
2557
|
-
let name = func.name;
|
|
2558
|
-
if (name?.length > 1)
|
|
2559
|
-
return name;
|
|
2560
|
-
if (named.has(func))
|
|
2561
|
-
return name;
|
|
2562
|
-
for (let key in this) {
|
|
2563
|
-
try {
|
|
2564
|
-
if (this[key] !== func)
|
|
2565
|
-
continue;
|
|
2566
|
-
name = key;
|
|
2567
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
2568
|
-
break;
|
|
2569
|
-
}
|
|
2570
|
-
catch { }
|
|
2571
|
-
}
|
|
2572
|
-
named.add(func);
|
|
2573
|
-
return name;
|
|
2574
|
-
}
|
|
2575
|
-
$.$mol_func_name = $mol_func_name;
|
|
2576
|
-
function $mol_func_name_from(target, source) {
|
|
2577
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
2578
|
-
return target;
|
|
2579
|
-
}
|
|
2580
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
2581
|
-
})($ || ($ = {}));
|
|
2582
|
-
//mol/func/name/name.ts
|
|
2583
|
-
;
|
|
2584
|
-
"use strict";
|
|
2585
|
-
var $;
|
|
2586
|
-
(function ($_1) {
|
|
2587
|
-
$mol_test({
|
|
2588
|
-
'FQN of anon function'($) {
|
|
2589
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
2590
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
2591
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
2592
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
2593
|
-
},
|
|
2594
|
-
});
|
|
2595
|
-
})($ || ($ = {}));
|
|
2596
|
-
//mol/func/name/name.test.ts
|
|
2597
|
-
;
|
|
2598
|
-
"use strict";
|
|
2599
|
-
var $;
|
|
2600
2603
|
(function ($) {
|
|
2601
2604
|
$mol_test({
|
|
2602
2605
|
'config by value'() {
|