mol_time_all 1.1.799 → 1.1.800
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
|
@@ -2066,6 +2066,9 @@ var $;
|
|
|
2066
2066
|
toString() {
|
|
2067
2067
|
return this[Symbol.toStringTag] || this.constructor.name + '()';
|
|
2068
2068
|
}
|
|
2069
|
+
static toJSON() {
|
|
2070
|
+
return this.$.$mol_func_name(this);
|
|
2071
|
+
}
|
|
2069
2072
|
toJSON() {
|
|
2070
2073
|
return this.toString();
|
|
2071
2074
|
}
|
|
@@ -2076,6 +2079,52 @@ var $;
|
|
|
2076
2079
|
;
|
|
2077
2080
|
"use strict";
|
|
2078
2081
|
var $;
|
|
2082
|
+
(function ($) {
|
|
2083
|
+
const named = new WeakSet();
|
|
2084
|
+
function $mol_func_name(func) {
|
|
2085
|
+
let name = func.name;
|
|
2086
|
+
if (name?.length > 1)
|
|
2087
|
+
return name;
|
|
2088
|
+
if (named.has(func))
|
|
2089
|
+
return name;
|
|
2090
|
+
for (let key in this) {
|
|
2091
|
+
try {
|
|
2092
|
+
if (this[key] !== func)
|
|
2093
|
+
continue;
|
|
2094
|
+
name = key;
|
|
2095
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
2096
|
+
break;
|
|
2097
|
+
}
|
|
2098
|
+
catch { }
|
|
2099
|
+
}
|
|
2100
|
+
named.add(func);
|
|
2101
|
+
return name;
|
|
2102
|
+
}
|
|
2103
|
+
$.$mol_func_name = $mol_func_name;
|
|
2104
|
+
function $mol_func_name_from(target, source) {
|
|
2105
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
2106
|
+
return target;
|
|
2107
|
+
}
|
|
2108
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
2109
|
+
})($ || ($ = {}));
|
|
2110
|
+
//mol/func/name/name.ts
|
|
2111
|
+
;
|
|
2112
|
+
"use strict";
|
|
2113
|
+
var $;
|
|
2114
|
+
(function ($_1) {
|
|
2115
|
+
$mol_test({
|
|
2116
|
+
'FQN of anon function'($) {
|
|
2117
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
2118
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
2119
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
2120
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
2121
|
+
},
|
|
2122
|
+
});
|
|
2123
|
+
})($ || ($ = {}));
|
|
2124
|
+
//mol/func/name/name.test.ts
|
|
2125
|
+
;
|
|
2126
|
+
"use strict";
|
|
2127
|
+
var $;
|
|
2079
2128
|
(function ($) {
|
|
2080
2129
|
const instances = new WeakSet();
|
|
2081
2130
|
function $mol_delegate(proto, target) {
|
|
@@ -2775,52 +2824,6 @@ var $;
|
|
|
2775
2824
|
;
|
|
2776
2825
|
"use strict";
|
|
2777
2826
|
var $;
|
|
2778
|
-
(function ($) {
|
|
2779
|
-
const named = new WeakSet();
|
|
2780
|
-
function $mol_func_name(func) {
|
|
2781
|
-
let name = func.name;
|
|
2782
|
-
if (name?.length > 1)
|
|
2783
|
-
return name;
|
|
2784
|
-
if (named.has(func))
|
|
2785
|
-
return name;
|
|
2786
|
-
for (let key in this) {
|
|
2787
|
-
try {
|
|
2788
|
-
if (this[key] !== func)
|
|
2789
|
-
continue;
|
|
2790
|
-
name = key;
|
|
2791
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
2792
|
-
break;
|
|
2793
|
-
}
|
|
2794
|
-
catch { }
|
|
2795
|
-
}
|
|
2796
|
-
named.add(func);
|
|
2797
|
-
return name;
|
|
2798
|
-
}
|
|
2799
|
-
$.$mol_func_name = $mol_func_name;
|
|
2800
|
-
function $mol_func_name_from(target, source) {
|
|
2801
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
2802
|
-
return target;
|
|
2803
|
-
}
|
|
2804
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
2805
|
-
})($ || ($ = {}));
|
|
2806
|
-
//mol/func/name/name.ts
|
|
2807
|
-
;
|
|
2808
|
-
"use strict";
|
|
2809
|
-
var $;
|
|
2810
|
-
(function ($_1) {
|
|
2811
|
-
$mol_test({
|
|
2812
|
-
'FQN of anon function'($) {
|
|
2813
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
2814
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
2815
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
2816
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
2817
|
-
},
|
|
2818
|
-
});
|
|
2819
|
-
})($ || ($ = {}));
|
|
2820
|
-
//mol/func/name/name.test.ts
|
|
2821
|
-
;
|
|
2822
|
-
"use strict";
|
|
2823
|
-
var $;
|
|
2824
2827
|
(function ($) {
|
|
2825
2828
|
$mol_test({
|
|
2826
2829
|
'parse and serial'() {
|