mol_time_all 1.1.799 → 1.1.801
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 +51 -47
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -1970,7 +1970,7 @@ var $;
|
|
|
1970
1970
|
try {
|
|
1971
1971
|
if (!having)
|
|
1972
1972
|
return false;
|
|
1973
|
-
if (typeof having !== 'object')
|
|
1973
|
+
if (typeof having !== 'object' && typeof having !== 'function')
|
|
1974
1974
|
return false;
|
|
1975
1975
|
if (having instanceof $mol_delegate)
|
|
1976
1976
|
return false;
|
|
@@ -2063,9 +2063,13 @@ var $;
|
|
|
2063
2063
|
return this.name;
|
|
2064
2064
|
}
|
|
2065
2065
|
destructor() { }
|
|
2066
|
+
static destructor() { }
|
|
2066
2067
|
toString() {
|
|
2067
2068
|
return this[Symbol.toStringTag] || this.constructor.name + '()';
|
|
2068
2069
|
}
|
|
2070
|
+
static toJSON() {
|
|
2071
|
+
return this[Symbol.toStringTag] || this.$.$mol_func_name(this);
|
|
2072
|
+
}
|
|
2069
2073
|
toJSON() {
|
|
2070
2074
|
return this.toString();
|
|
2071
2075
|
}
|
|
@@ -2076,6 +2080,52 @@ var $;
|
|
|
2076
2080
|
;
|
|
2077
2081
|
"use strict";
|
|
2078
2082
|
var $;
|
|
2083
|
+
(function ($) {
|
|
2084
|
+
const named = new WeakSet();
|
|
2085
|
+
function $mol_func_name(func) {
|
|
2086
|
+
let name = func.name;
|
|
2087
|
+
if (name?.length > 1)
|
|
2088
|
+
return name;
|
|
2089
|
+
if (named.has(func))
|
|
2090
|
+
return name;
|
|
2091
|
+
for (let key in this) {
|
|
2092
|
+
try {
|
|
2093
|
+
if (this[key] !== func)
|
|
2094
|
+
continue;
|
|
2095
|
+
name = key;
|
|
2096
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
catch { }
|
|
2100
|
+
}
|
|
2101
|
+
named.add(func);
|
|
2102
|
+
return name;
|
|
2103
|
+
}
|
|
2104
|
+
$.$mol_func_name = $mol_func_name;
|
|
2105
|
+
function $mol_func_name_from(target, source) {
|
|
2106
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
2107
|
+
return target;
|
|
2108
|
+
}
|
|
2109
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
2110
|
+
})($ || ($ = {}));
|
|
2111
|
+
//mol/func/name/name.ts
|
|
2112
|
+
;
|
|
2113
|
+
"use strict";
|
|
2114
|
+
var $;
|
|
2115
|
+
(function ($_1) {
|
|
2116
|
+
$mol_test({
|
|
2117
|
+
'FQN of anon function'($) {
|
|
2118
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
2119
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
2120
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
2121
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
2122
|
+
},
|
|
2123
|
+
});
|
|
2124
|
+
})($ || ($ = {}));
|
|
2125
|
+
//mol/func/name/name.test.ts
|
|
2126
|
+
;
|
|
2127
|
+
"use strict";
|
|
2128
|
+
var $;
|
|
2079
2129
|
(function ($) {
|
|
2080
2130
|
const instances = new WeakSet();
|
|
2081
2131
|
function $mol_delegate(proto, target) {
|
|
@@ -2775,52 +2825,6 @@ var $;
|
|
|
2775
2825
|
;
|
|
2776
2826
|
"use strict";
|
|
2777
2827
|
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
2828
|
(function ($) {
|
|
2825
2829
|
$mol_test({
|
|
2826
2830
|
'parse and serial'() {
|