mol_time_all 1.1.91 → 1.1.95
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 +156 -0
- package/node.deps.json +1 -1
- package/node.test.js +8 -0
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +156 -0
- package/web.deps.json +1 -1
- package/web.test.js +8 -0
- package/web.test.js.map +1 -1
package/node.d.ts
CHANGED
|
@@ -1,2 +1,158 @@
|
|
|
1
|
+
declare let _$_: {
|
|
2
|
+
new (): {};
|
|
3
|
+
} & typeof globalThis;
|
|
4
|
+
declare class $ extends _$_ {
|
|
5
|
+
}
|
|
6
|
+
declare namespace $ {
|
|
7
|
+
export type $ = typeof $$;
|
|
8
|
+
export class $$ extends $ {
|
|
9
|
+
}
|
|
10
|
+
namespace $$ {
|
|
11
|
+
type $$ = $;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare namespace $ {
|
|
17
|
+
class $mol_time_base {
|
|
18
|
+
static patterns: Record<string, (arg: any) => string>;
|
|
19
|
+
static formatter(pattern: string): (arg: any) => string;
|
|
20
|
+
toString(pattern: string): string;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare namespace $ {
|
|
25
|
+
type $mol_time_duration_config = number | string | {
|
|
26
|
+
year?: number;
|
|
27
|
+
month?: number;
|
|
28
|
+
day?: number;
|
|
29
|
+
hour?: number;
|
|
30
|
+
minute?: number;
|
|
31
|
+
second?: number;
|
|
32
|
+
};
|
|
33
|
+
class $mol_time_duration extends $mol_time_base {
|
|
34
|
+
constructor(config?: $mol_time_duration_config);
|
|
35
|
+
readonly year: number;
|
|
36
|
+
readonly month: number;
|
|
37
|
+
readonly day: number;
|
|
38
|
+
readonly hour: number;
|
|
39
|
+
readonly minute: number;
|
|
40
|
+
readonly second: number;
|
|
41
|
+
summ(config: $mol_time_duration_config): $mol_time_duration;
|
|
42
|
+
mult(numb: number): $mol_time_duration;
|
|
43
|
+
count(config: $mol_time_duration_config): number;
|
|
44
|
+
valueOf(): number;
|
|
45
|
+
toJSON(): string;
|
|
46
|
+
toString(pattern?: string): string;
|
|
47
|
+
[Symbol.toPrimitive](mode: 'default' | 'number' | 'string'): string | number;
|
|
48
|
+
static patterns: {
|
|
49
|
+
'#Y': (duration: $mol_time_duration) => string;
|
|
50
|
+
'#M': (duration: $mol_time_duration) => string;
|
|
51
|
+
'#D': (duration: $mol_time_duration) => string;
|
|
52
|
+
'#h': (duration: $mol_time_duration) => string;
|
|
53
|
+
'#m': (duration: $mol_time_duration) => string;
|
|
54
|
+
'#s': (duration: $mol_time_duration) => string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare namespace $ {
|
|
60
|
+
function $mol_fail(error: any): never;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare namespace $ {
|
|
64
|
+
enum $mol_time_moment_weekdays {
|
|
65
|
+
monday = 0,
|
|
66
|
+
tuesday = 1,
|
|
67
|
+
wednesday = 2,
|
|
68
|
+
thursday = 3,
|
|
69
|
+
friday = 4,
|
|
70
|
+
saturday = 5,
|
|
71
|
+
sunday = 6
|
|
72
|
+
}
|
|
73
|
+
type $mol_time_moment_config = number | Date | string | {
|
|
74
|
+
year?: number;
|
|
75
|
+
month?: number;
|
|
76
|
+
day?: number;
|
|
77
|
+
hour?: number;
|
|
78
|
+
minute?: number;
|
|
79
|
+
second?: number;
|
|
80
|
+
offset?: $mol_time_duration_config;
|
|
81
|
+
};
|
|
82
|
+
class $mol_time_moment extends $mol_time_base {
|
|
83
|
+
constructor(config?: $mol_time_moment_config);
|
|
84
|
+
readonly year: number | undefined;
|
|
85
|
+
readonly month: number | undefined;
|
|
86
|
+
readonly day: number | undefined;
|
|
87
|
+
readonly hour: number | undefined;
|
|
88
|
+
readonly minute: number | undefined;
|
|
89
|
+
readonly second: number | undefined;
|
|
90
|
+
readonly offset: $mol_time_duration | undefined;
|
|
91
|
+
get weekday(): number;
|
|
92
|
+
_native: Date | undefined;
|
|
93
|
+
get native(): Date;
|
|
94
|
+
_normal: $mol_time_moment | undefined;
|
|
95
|
+
get normal(): $mol_time_moment;
|
|
96
|
+
merge(config: $mol_time_moment_config): $mol_time_moment;
|
|
97
|
+
shift(config: $mol_time_duration_config): $mol_time_moment;
|
|
98
|
+
mask(config: $mol_time_moment_config): $mol_time_moment;
|
|
99
|
+
toOffset(config: $mol_time_duration_config): $mol_time_moment;
|
|
100
|
+
valueOf(): number;
|
|
101
|
+
toJSON(): string;
|
|
102
|
+
toString(pattern?: string): string;
|
|
103
|
+
[Symbol.toPrimitive](mode: 'default' | 'number' | 'string'): string | number;
|
|
104
|
+
static patterns: {
|
|
105
|
+
YYYY: (moment: $mol_time_moment) => string;
|
|
106
|
+
AD: (moment: $mol_time_moment) => string;
|
|
107
|
+
YY: (moment: $mol_time_moment) => string;
|
|
108
|
+
Month: (moment: $mol_time_moment) => string;
|
|
109
|
+
'DD Month': (moment: $mol_time_moment) => string;
|
|
110
|
+
'D Month': (moment: $mol_time_moment) => string;
|
|
111
|
+
Mon: (moment: $mol_time_moment) => string;
|
|
112
|
+
'DD Mon': (moment: $mol_time_moment) => string;
|
|
113
|
+
'D Mon': (moment: $mol_time_moment) => string;
|
|
114
|
+
'-MM': (moment: $mol_time_moment) => string;
|
|
115
|
+
MM: (moment: $mol_time_moment) => string;
|
|
116
|
+
M: (moment: $mol_time_moment) => string;
|
|
117
|
+
WeekDay: (moment: $mol_time_moment) => string;
|
|
118
|
+
WD: (moment: $mol_time_moment) => string;
|
|
119
|
+
'-DD': (moment: $mol_time_moment) => string;
|
|
120
|
+
DD: (moment: $mol_time_moment) => string;
|
|
121
|
+
D: (moment: $mol_time_moment) => string;
|
|
122
|
+
Thh: (moment: $mol_time_moment) => string;
|
|
123
|
+
hh: (moment: $mol_time_moment) => string;
|
|
124
|
+
h: (moment: $mol_time_moment) => string;
|
|
125
|
+
':mm': (moment: $mol_time_moment) => string;
|
|
126
|
+
mm: (moment: $mol_time_moment) => string;
|
|
127
|
+
m: (moment: $mol_time_moment) => string;
|
|
128
|
+
':ss': (moment: $mol_time_moment) => string;
|
|
129
|
+
ss: (moment: $mol_time_moment) => string;
|
|
130
|
+
s: (moment: $mol_time_moment) => string;
|
|
131
|
+
'.sss': (moment: $mol_time_moment) => string;
|
|
132
|
+
sss: (moment: $mol_time_moment) => string;
|
|
133
|
+
Z: (moment: $mol_time_moment) => string;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare namespace $ {
|
|
139
|
+
type $mol_time_interval_config = string | {
|
|
140
|
+
start?: $mol_time_moment_config;
|
|
141
|
+
end?: $mol_time_moment_config;
|
|
142
|
+
duration?: $mol_time_duration_config;
|
|
143
|
+
};
|
|
144
|
+
class $mol_time_interval extends $mol_time_base {
|
|
145
|
+
constructor(config: $mol_time_interval_config);
|
|
146
|
+
private _start;
|
|
147
|
+
get start(): $mol_time_moment;
|
|
148
|
+
private _end;
|
|
149
|
+
get end(): $mol_time_moment;
|
|
150
|
+
private _duration;
|
|
151
|
+
get duration(): $mol_time_duration;
|
|
152
|
+
toJSON(): string;
|
|
153
|
+
toString(): string;
|
|
154
|
+
[Symbol.toPrimitive](mode: 'default' | 'number' | 'string'): string;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
1
157
|
|
|
2
158
|
export = $;
|
package/node.deps.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/time/readme.md","mol/time/base/base.ts","mol/time/duration/duration.ts","mol/time/duration/readme.md","mol/fail/fail.ts","mol/time/moment/moment.ts","mol/time/moment/readme.md","mol/time/interval/interval.ts","mol/time/interval/readme.md","mol/time/all/all.meta.tree","mol/time/all/package.json"],"mods":{},"deps_in":{"mol/time":{"mol/time/all":-9007199254740991,"mol/time/moment":-9007199254740991,"mol/time/duration":-9007199254740991,"mol/time/base":-9007199254740991,"mol/time/interval":-9007199254740991},"mol":{"mol/time":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/time/moment":{"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/duration":{"mol/time/moment":-2,"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/base":{"mol/time/duration":-1,"mol/time/moment":-1,"mol/time/interval":-1},"mol/fail":{"mol/time/moment":-2},"mol/time/interval":{"mol/time/all":-9000}},"deps_out":{"mol/time/all":{"mol/time":-9007199254740991,"mol/time/moment":-9000,"mol/time/duration":-9000,"mol/time/interval":-9000},"mol/time":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/time/moment":{"mol/time":-9007199254740991,"mol/time/duration":-2,"mol/fail":-2,"mol/time/base":-1},"mol/time/duration":{"mol/time":-9007199254740991,"mol/time/base":-1},"mol/time/base":{"mol/time":-9007199254740991},"mol/fail":{"mol":-9007199254740991},"mol/time/interval":{"mol/time":-9007199254740991,"mol/time/moment":-2,"mol/time/duration":-2,"mol/time/base":-1}},"sloc":{"LICENSE":113,"md":737,"tree":34,"js":10,"ts":586,"json":
|
|
1
|
+
{"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/time/readme.md","mol/time/base/base.ts","mol/time/duration/duration.ts","mol/time/duration/readme.md","mol/fail/fail.ts","mol/time/moment/moment.ts","mol/time/moment/readme.md","mol/time/interval/interval.ts","mol/time/interval/readme.md","mol/time/all/all.meta.tree","mol/time/all/package.json"],"mods":{},"deps_in":{"mol/time":{"mol/time/all":-9007199254740991,"mol/time/moment":-9007199254740991,"mol/time/duration":-9007199254740991,"mol/time/base":-9007199254740991,"mol/time/interval":-9007199254740991},"mol":{"mol/time":-9007199254740991,"mol/fail":-9007199254740991},"":{"mol":-9007199254740991},"mol/time/moment":{"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/duration":{"mol/time/moment":-2,"mol/time/all":-9000,"mol/time/interval":-2},"mol/time/base":{"mol/time/duration":-1,"mol/time/moment":-1,"mol/time/interval":-1},"mol/fail":{"mol/time/moment":-2},"mol/time/interval":{"mol/time/all":-9000}},"deps_out":{"mol/time/all":{"mol/time":-9007199254740991,"mol/time/moment":-9000,"mol/time/duration":-9000,"mol/time/interval":-9000},"mol/time":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/time/moment":{"mol/time":-9007199254740991,"mol/time/duration":-2,"mol/fail":-2,"mol/time/base":-1},"mol/time/duration":{"mol/time":-9007199254740991,"mol/time/base":-1},"mol/time/base":{"mol/time":-9007199254740991},"mol/fail":{"mol":-9007199254740991},"mol/time/interval":{"mol/time":-9007199254740991,"mol/time/moment":-2,"mol/time/duration":-2,"mol/time/base":-1}},"sloc":{"LICENSE":113,"md":737,"tree":34,"js":10,"ts":586,"json":88,"lock":939,"CNAME":1,"html":1},"deps":{"mol/time/all":{"..":-9007199254740991,"/mol/time/moment":-9000,"/mol/time/duration":-9000,"/mol/time/interval":-9000},"mol/time":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/time/moment":{"..":-9007199254740991,"/mol/time/moment/weekdays":-1,"/mol/time/moment/config":-1,"/mol/time/duration/config":-2,"/mol/fail":-2,"/mol/time/moment":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment/patterns":-4},"mol/time/duration":{"..":-9007199254740991,"/mol/time/duration/config":-1,"/mol/time/duration":-1,"/mol/time/base":-1},"mol/time/base":{"..":-9007199254740991,"/mol/time/base":-1},"mol/fail":{"..":-9007199254740991,"/mol/fail":-1},"mol/time/interval":{"..":-9007199254740991,"/mol/time/interval/config":-1,"/mol/time/moment/config":-2,"/mol/time/duration/config":-2,"/mol/time/interval":-1,"/mol/time/base":-1,"/mol/time/duration":-2,"/mol/time/moment":-2}}}
|
package/node.test.js
CHANGED
|
@@ -1092,6 +1092,12 @@ var $;
|
|
|
1092
1092
|
$mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
|
|
1093
1093
|
$mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
|
|
1094
1094
|
},
|
|
1095
|
+
'Error'() {
|
|
1096
|
+
$mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
|
|
1097
|
+
const fail = (message) => new Error(message);
|
|
1098
|
+
$mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
|
|
1099
|
+
$mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
|
|
1100
|
+
},
|
|
1095
1101
|
'Map'() {
|
|
1096
1102
|
$mol_assert_ok($mol_compare_deep(new Map, new Map));
|
|
1097
1103
|
$mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
|
|
@@ -1176,6 +1182,8 @@ var $;
|
|
|
1176
1182
|
result = compare_set(left, right);
|
|
1177
1183
|
else if (left instanceof Map)
|
|
1178
1184
|
result = compare_map(left, right);
|
|
1185
|
+
else if (left instanceof Error)
|
|
1186
|
+
result = left.stack === right.stack;
|
|
1179
1187
|
else if (ArrayBuffer.isView(left))
|
|
1180
1188
|
result = compare_buffer(left, right);
|
|
1181
1189
|
else if (Symbol.toPrimitive in left)
|