@storm-software/config-tools 1.190.119 → 1.190.121
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/README.md +1 -1
- package/bin/config.cjs +1213 -1558
- package/bin/config.mjs +1271 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/config-file/get-config-file.cjs +67 -28
- package/dist/config-file/get-config-file.d.cts +5 -5
- package/dist/config-file/{get-config-file.d.ts → get-config-file.d.mts} +7 -5
- package/dist/config-file/get-config-file.mjs +66 -0
- package/dist/config-file/index.cjs +4 -29
- package/dist/config-file/index.d.cts +2 -3
- package/dist/config-file/index.d.mts +4 -0
- package/dist/config-file/index.mjs +5 -0
- package/dist/create-storm-config.cjs +115 -34
- package/dist/create-storm-config.d.cts +5 -5
- package/dist/{create-storm-config.d.ts → create-storm-config.d.mts} +7 -5
- package/dist/create-storm-config.mjs +113 -0
- package/dist/env/get-env.cjs +202 -11
- package/dist/env/get-env.d.cts +5 -5
- package/dist/env/{get-env.d.ts → get-env.d.mts} +7 -5
- package/dist/env/get-env.mjs +203 -0
- package/dist/env/index.cjs +7 -18
- package/dist/env/index.d.cts +3 -4
- package/dist/env/index.d.mts +5 -0
- package/dist/env/index.mjs +6 -0
- package/dist/env/set-env.cjs +230 -11
- package/dist/env/set-env.d.cts +8 -8
- package/dist/env/{set-env.d.ts → set-env.d.mts} +10 -8
- package/dist/env/set-env.mjs +231 -0
- package/dist/get-config.cjs +46 -34
- package/dist/get-config.d.cts +18 -18
- package/dist/{get-config.d.ts → get-config.d.mts} +20 -18
- package/dist/get-config.mjs +46 -0
- package/dist/index.cjs +98 -201
- package/dist/index.d.cts +27 -28
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +26 -0
- package/dist/logger/chalk.cjs +43 -6
- package/dist/logger/chalk.d.cts +18 -17
- package/dist/logger/chalk.d.mts +37 -0
- package/dist/logger/chalk.mjs +43 -0
- package/dist/logger/console-icons.cjs +18 -8
- package/dist/logger/console-icons.d.cts +5 -8
- package/dist/logger/console-icons.d.mts +7 -0
- package/dist/logger/console-icons.mjs +20 -0
- package/dist/logger/console.cjs +195 -37
- package/dist/logger/console.d.cts +25 -25
- package/dist/logger/{console.d.ts → console.d.mts} +27 -25
- package/dist/logger/console.mjs +185 -0
- package/dist/logger/create-logger.cjs +34 -14
- package/dist/logger/create-logger.d.cts +5 -6
- package/dist/logger/{create-logger.d.ts → create-logger.d.mts} +7 -6
- package/dist/logger/create-logger.mjs +34 -0
- package/dist/logger/format-timestamp.cjs +14 -6
- package/dist/logger/format-timestamp.d.cts +3 -2
- package/dist/logger/{format-timestamp.d.ts → format-timestamp.d.mts} +5 -2
- package/dist/logger/format-timestamp.mjs +16 -0
- package/dist/logger/get-log-level.cjs +54 -11
- package/dist/logger/get-log-level.d.cts +4 -5
- package/dist/logger/{get-log-level.d.ts → get-log-level.d.mts} +6 -5
- package/dist/logger/get-log-level.mjs +54 -0
- package/dist/logger/index.cjs +29 -61
- package/dist/logger/index.d.cts +8 -10
- package/dist/logger/index.d.mts +10 -0
- package/dist/logger/index.mjs +11 -0
- package/dist/logger/is-unicode-supported.cjs +8 -6
- package/dist/logger/is-unicode-supported.d.cts +3 -2
- package/dist/logger/is-unicode-supported.d.mts +6 -0
- package/dist/logger/is-unicode-supported.mjs +10 -0
- package/dist/types.cjs +29 -8
- package/dist/types.d.cts +39 -41
- package/dist/types.d.mts +53 -0
- package/dist/types.mjs +30 -0
- package/dist/utilities/apply-workspace-tokens.cjs +37 -13
- package/dist/utilities/apply-workspace-tokens.d.cts +4 -5
- package/dist/utilities/{apply-workspace-tokens.d.ts → apply-workspace-tokens.d.mts} +6 -5
- package/dist/utilities/apply-workspace-tokens.mjs +37 -0
- package/dist/utilities/colors.cjs +98 -12
- package/dist/utilities/colors.d.cts +4 -4
- package/dist/utilities/{colors.d.ts → colors.d.mts} +6 -4
- package/dist/utilities/colors.mjs +97 -0
- package/dist/utilities/correct-paths.cjs +201 -32
- package/dist/utilities/correct-paths.d.cts +4 -4
- package/dist/utilities/{correct-paths.d.ts → correct-paths.d.mts} +6 -4
- package/dist/utilities/correct-paths.mjs +190 -0
- package/dist/utilities/file-path-utils.cjs +48 -11
- package/dist/utilities/file-path-utils.d.cts +15 -14
- package/dist/utilities/{file-path-utils.d.ts → file-path-utils.d.mts} +17 -14
- package/dist/utilities/file-path-utils.mjs +48 -0
- package/dist/utilities/find-up.cjs +17 -6
- package/dist/utilities/find-up.d.cts +3 -2
- package/dist/utilities/{find-up.d.ts → find-up.d.mts} +5 -2
- package/dist/utilities/find-up.mjs +19 -0
- package/dist/utilities/find-workspace-root.cjs +72 -10
- package/dist/utilities/find-workspace-root.d.cts +3 -2
- package/dist/utilities/{find-workspace-root.d.ts → find-workspace-root.d.mts} +5 -2
- package/dist/utilities/find-workspace-root.mjs +73 -0
- package/dist/utilities/get-default-config.cjs +73 -11
- package/dist/utilities/get-default-config.d.cts +4 -4
- package/dist/utilities/{get-default-config.d.ts → get-default-config.d.mts} +6 -4
- package/dist/utilities/get-default-config.mjs +74 -0
- package/dist/utilities/index.cjs +49 -109
- package/dist/utilities/index.d.cts +10 -14
- package/dist/utilities/index.d.mts +12 -0
- package/dist/utilities/index.mjs +13 -0
- package/dist/utilities/process-handler.cjs +38 -18
- package/dist/utilities/process-handler.d.cts +4 -4
- package/dist/utilities/process-handler.d.mts +9 -0
- package/dist/utilities/process-handler.mjs +38 -0
- package/dist/utilities/run.cjs +64 -10
- package/dist/utilities/run.d.cts +5 -6
- package/dist/utilities/{run.d.ts → run.d.mts} +7 -6
- package/dist/utilities/run.mjs +64 -0
- package/dist/utilities/toml.cjs +37 -24
- package/dist/utilities/toml.d.cts +148 -147
- package/dist/utilities/toml.d.mts +192 -0
- package/dist/utilities/toml.mjs +33 -0
- package/package.json +106 -158
- package/bin/config.js +0 -1616
- package/dist/chunk-24B36RDB.cjs +0 -81
- package/dist/chunk-27N3QEX5.js +0 -40
- package/dist/chunk-2AVLCXLT.js +0 -0
- package/dist/chunk-2RLMTBVZ.js +0 -233
- package/dist/chunk-2WBD2G3E.cjs +0 -38
- package/dist/chunk-3COHMHPU.cjs +0 -1
- package/dist/chunk-4Q45WJYQ.js +0 -165
- package/dist/chunk-5C7PIENF.js +0 -92
- package/dist/chunk-5J2SS4QU.js +0 -83
- package/dist/chunk-65SWKEHV.cjs +0 -1
- package/dist/chunk-6Y623TCS.cjs +0 -40
- package/dist/chunk-7PV6L7I7.cjs +0 -1
- package/dist/chunk-7QBTVNMR.cjs +0 -30
- package/dist/chunk-BDATZ3UB.cjs +0 -233
- package/dist/chunk-BZRTSWH4.cjs +0 -395
- package/dist/chunk-D3FRXXDE.js +0 -947
- package/dist/chunk-DTGT4OI3.cjs +0 -14
- package/dist/chunk-EC2KPWRG.cjs +0 -24
- package/dist/chunk-EENQN6N2.js +0 -40
- package/dist/chunk-ENI4UUSK.cjs +0 -35
- package/dist/chunk-FJNXECWU.js +0 -395
- package/dist/chunk-FMDVBSP6.cjs +0 -83
- package/dist/chunk-G2MK47WL.js +0 -14
- package/dist/chunk-HFS7WJVW.js +0 -81
- package/dist/chunk-HVVJHTFS.js +0 -36
- package/dist/chunk-IWD6YQKX.cjs +0 -1
- package/dist/chunk-IWQRXQ4N.cjs +0 -84
- package/dist/chunk-JK4TT5IV.js +0 -35
- package/dist/chunk-JWLDCEBZ.cjs +0 -70
- package/dist/chunk-JZAYHDV3.js +0 -8
- package/dist/chunk-KSMN3HSC.js +0 -38
- package/dist/chunk-L6UNTUC4.js +0 -0
- package/dist/chunk-LOY6ICHZ.cjs +0 -36
- package/dist/chunk-MBG2FTBL.cjs +0 -47
- package/dist/chunk-MQG74XF7.js +0 -102
- package/dist/chunk-MSAQEGBK.cjs +0 -92
- package/dist/chunk-NJFLUTGH.cjs +0 -25
- package/dist/chunk-PCYB64MB.cjs +0 -40
- package/dist/chunk-RALMUN5C.js +0 -30
- package/dist/chunk-RRKB32OH.js +0 -0
- package/dist/chunk-RUKM6FCF.js +0 -25
- package/dist/chunk-SIW7AXUG.js +0 -56
- package/dist/chunk-SLICWTO2.cjs +0 -165
- package/dist/chunk-SO3FWVXC.js +0 -84
- package/dist/chunk-SXPH7ILL.js +0 -70
- package/dist/chunk-T7YISGRS.cjs +0 -102
- package/dist/chunk-TZZRLM5J.cjs +0 -947
- package/dist/chunk-UJ77IBHD.cjs +0 -233
- package/dist/chunk-UKGRDKIH.js +0 -0
- package/dist/chunk-V3GMJ4TX.js +0 -233
- package/dist/chunk-WQJYIPSL.cjs +0 -8
- package/dist/chunk-YBVOKYAM.cjs +0 -56
- package/dist/chunk-YX4736HU.js +0 -47
- package/dist/chunk-ZFNAUMQS.js +0 -24
- package/dist/config-file/get-config-file.js +0 -28
- package/dist/config-file/index.d.ts +0 -3
- package/dist/config-file/index.js +0 -29
- package/dist/create-storm-config.js +0 -35
- package/dist/env/get-env.js +0 -11
- package/dist/env/index.d.ts +0 -4
- package/dist/env/index.js +0 -18
- package/dist/env/set-env.js +0 -11
- package/dist/get-config.js +0 -34
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -201
- package/dist/logger/chalk.d.ts +0 -34
- package/dist/logger/chalk.js +0 -6
- package/dist/logger/console-icons.d.ts +0 -8
- package/dist/logger/console-icons.js +0 -8
- package/dist/logger/console.js +0 -37
- package/dist/logger/create-logger.js +0 -14
- package/dist/logger/format-timestamp.js +0 -6
- package/dist/logger/get-log-level.js +0 -11
- package/dist/logger/index.d.ts +0 -10
- package/dist/logger/index.js +0 -61
- package/dist/logger/is-unicode-supported.d.ts +0 -3
- package/dist/logger/is-unicode-supported.js +0 -6
- package/dist/types.d.ts +0 -53
- package/dist/types.js +0 -8
- package/dist/utilities/apply-workspace-tokens.js +0 -13
- package/dist/utilities/colors.js +0 -12
- package/dist/utilities/correct-paths.js +0 -32
- package/dist/utilities/file-path-utils.js +0 -11
- package/dist/utilities/find-up.js +0 -6
- package/dist/utilities/find-workspace-root.js +0 -10
- package/dist/utilities/get-default-config.js +0 -11
- package/dist/utilities/index.d.ts +0 -14
- package/dist/utilities/index.js +0 -109
- package/dist/utilities/process-handler.d.ts +0 -7
- package/dist/utilities/process-handler.js +0 -18
- package/dist/utilities/run.js +0 -10
- package/dist/utilities/toml.d.ts +0 -189
- package/dist/utilities/toml.js +0 -24
package/dist/chunk-D3FRXXDE.js
DELETED
|
@@ -1,947 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_COLOR_CONFIG,
|
|
3
|
-
getColor
|
|
4
|
-
} from "./chunk-5J2SS4QU.js";
|
|
5
|
-
import {
|
|
6
|
-
getChalk
|
|
7
|
-
} from "./chunk-HVVJHTFS.js";
|
|
8
|
-
import {
|
|
9
|
-
CONSOLE_ICONS
|
|
10
|
-
} from "./chunk-ZFNAUMQS.js";
|
|
11
|
-
import {
|
|
12
|
-
formatTimestamp
|
|
13
|
-
} from "./chunk-JZAYHDV3.js";
|
|
14
|
-
import {
|
|
15
|
-
getLogLevel
|
|
16
|
-
} from "./chunk-SXPH7ILL.js";
|
|
17
|
-
import {
|
|
18
|
-
LogLevel,
|
|
19
|
-
LogLevelLabel
|
|
20
|
-
} from "./chunk-RALMUN5C.js";
|
|
21
|
-
|
|
22
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js
|
|
23
|
-
var daysInYear = 365.2425;
|
|
24
|
-
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
25
|
-
var minTime = -maxTime;
|
|
26
|
-
var minutesInMonth = 43200;
|
|
27
|
-
var minutesInDay = 1440;
|
|
28
|
-
var secondsInHour = 3600;
|
|
29
|
-
var secondsInDay = secondsInHour * 24;
|
|
30
|
-
var secondsInWeek = secondsInDay * 7;
|
|
31
|
-
var secondsInYear = secondsInDay * daysInYear;
|
|
32
|
-
var secondsInMonth = secondsInYear / 12;
|
|
33
|
-
var secondsInQuarter = secondsInMonth * 3;
|
|
34
|
-
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
35
|
-
|
|
36
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js
|
|
37
|
-
function constructFrom(date, value) {
|
|
38
|
-
if (typeof date === "function") return date(value);
|
|
39
|
-
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
40
|
-
return date[constructFromSymbol](value);
|
|
41
|
-
if (date instanceof Date) return new date.constructor(value);
|
|
42
|
-
return new Date(value);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructNow.js
|
|
46
|
-
function constructNow(date) {
|
|
47
|
-
return constructFrom(date, Date.now());
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
51
|
-
var formatDistanceLocale = {
|
|
52
|
-
lessThanXSeconds: {
|
|
53
|
-
one: "less than a second",
|
|
54
|
-
other: "less than {{count}} seconds"
|
|
55
|
-
},
|
|
56
|
-
xSeconds: {
|
|
57
|
-
one: "1 second",
|
|
58
|
-
other: "{{count}} seconds"
|
|
59
|
-
},
|
|
60
|
-
halfAMinute: "half a minute",
|
|
61
|
-
lessThanXMinutes: {
|
|
62
|
-
one: "less than a minute",
|
|
63
|
-
other: "less than {{count}} minutes"
|
|
64
|
-
},
|
|
65
|
-
xMinutes: {
|
|
66
|
-
one: "1 minute",
|
|
67
|
-
other: "{{count}} minutes"
|
|
68
|
-
},
|
|
69
|
-
aboutXHours: {
|
|
70
|
-
one: "about 1 hour",
|
|
71
|
-
other: "about {{count}} hours"
|
|
72
|
-
},
|
|
73
|
-
xHours: {
|
|
74
|
-
one: "1 hour",
|
|
75
|
-
other: "{{count}} hours"
|
|
76
|
-
},
|
|
77
|
-
xDays: {
|
|
78
|
-
one: "1 day",
|
|
79
|
-
other: "{{count}} days"
|
|
80
|
-
},
|
|
81
|
-
aboutXWeeks: {
|
|
82
|
-
one: "about 1 week",
|
|
83
|
-
other: "about {{count}} weeks"
|
|
84
|
-
},
|
|
85
|
-
xWeeks: {
|
|
86
|
-
one: "1 week",
|
|
87
|
-
other: "{{count}} weeks"
|
|
88
|
-
},
|
|
89
|
-
aboutXMonths: {
|
|
90
|
-
one: "about 1 month",
|
|
91
|
-
other: "about {{count}} months"
|
|
92
|
-
},
|
|
93
|
-
xMonths: {
|
|
94
|
-
one: "1 month",
|
|
95
|
-
other: "{{count}} months"
|
|
96
|
-
},
|
|
97
|
-
aboutXYears: {
|
|
98
|
-
one: "about 1 year",
|
|
99
|
-
other: "about {{count}} years"
|
|
100
|
-
},
|
|
101
|
-
xYears: {
|
|
102
|
-
one: "1 year",
|
|
103
|
-
other: "{{count}} years"
|
|
104
|
-
},
|
|
105
|
-
overXYears: {
|
|
106
|
-
one: "over 1 year",
|
|
107
|
-
other: "over {{count}} years"
|
|
108
|
-
},
|
|
109
|
-
almostXYears: {
|
|
110
|
-
one: "almost 1 year",
|
|
111
|
-
other: "almost {{count}} years"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
var formatDistance = (token, count, options) => {
|
|
115
|
-
let result;
|
|
116
|
-
const tokenValue = formatDistanceLocale[token];
|
|
117
|
-
if (typeof tokenValue === "string") {
|
|
118
|
-
result = tokenValue;
|
|
119
|
-
} else if (count === 1) {
|
|
120
|
-
result = tokenValue.one;
|
|
121
|
-
} else {
|
|
122
|
-
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
123
|
-
}
|
|
124
|
-
if (options?.addSuffix) {
|
|
125
|
-
if (options.comparison && options.comparison > 0) {
|
|
126
|
-
return "in " + result;
|
|
127
|
-
} else {
|
|
128
|
-
return result + " ago";
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return result;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
135
|
-
function buildFormatLongFn(args) {
|
|
136
|
-
return (options = {}) => {
|
|
137
|
-
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
138
|
-
const format = args.formats[width] || args.formats[args.defaultWidth];
|
|
139
|
-
return format;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
|
|
144
|
-
var dateFormats = {
|
|
145
|
-
full: "EEEE, MMMM do, y",
|
|
146
|
-
long: "MMMM do, y",
|
|
147
|
-
medium: "MMM d, y",
|
|
148
|
-
short: "MM/dd/yyyy"
|
|
149
|
-
};
|
|
150
|
-
var timeFormats = {
|
|
151
|
-
full: "h:mm:ss a zzzz",
|
|
152
|
-
long: "h:mm:ss a z",
|
|
153
|
-
medium: "h:mm:ss a",
|
|
154
|
-
short: "h:mm a"
|
|
155
|
-
};
|
|
156
|
-
var dateTimeFormats = {
|
|
157
|
-
full: "{{date}} 'at' {{time}}",
|
|
158
|
-
long: "{{date}} 'at' {{time}}",
|
|
159
|
-
medium: "{{date}}, {{time}}",
|
|
160
|
-
short: "{{date}}, {{time}}"
|
|
161
|
-
};
|
|
162
|
-
var formatLong = {
|
|
163
|
-
date: buildFormatLongFn({
|
|
164
|
-
formats: dateFormats,
|
|
165
|
-
defaultWidth: "full"
|
|
166
|
-
}),
|
|
167
|
-
time: buildFormatLongFn({
|
|
168
|
-
formats: timeFormats,
|
|
169
|
-
defaultWidth: "full"
|
|
170
|
-
}),
|
|
171
|
-
dateTime: buildFormatLongFn({
|
|
172
|
-
formats: dateTimeFormats,
|
|
173
|
-
defaultWidth: "full"
|
|
174
|
-
})
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
|
178
|
-
var formatRelativeLocale = {
|
|
179
|
-
lastWeek: "'last' eeee 'at' p",
|
|
180
|
-
yesterday: "'yesterday at' p",
|
|
181
|
-
today: "'today at' p",
|
|
182
|
-
tomorrow: "'tomorrow at' p",
|
|
183
|
-
nextWeek: "eeee 'at' p",
|
|
184
|
-
other: "P"
|
|
185
|
-
};
|
|
186
|
-
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
187
|
-
|
|
188
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
189
|
-
function buildLocalizeFn(args) {
|
|
190
|
-
return (value, options) => {
|
|
191
|
-
const context = options?.context ? String(options.context) : "standalone";
|
|
192
|
-
let valuesArray;
|
|
193
|
-
if (context === "formatting" && args.formattingValues) {
|
|
194
|
-
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
195
|
-
const width = options?.width ? String(options.width) : defaultWidth;
|
|
196
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
197
|
-
} else {
|
|
198
|
-
const defaultWidth = args.defaultWidth;
|
|
199
|
-
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
200
|
-
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
201
|
-
}
|
|
202
|
-
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
203
|
-
return valuesArray[index];
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js
|
|
208
|
-
var eraValues = {
|
|
209
|
-
narrow: ["B", "A"],
|
|
210
|
-
abbreviated: ["BC", "AD"],
|
|
211
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
212
|
-
};
|
|
213
|
-
var quarterValues = {
|
|
214
|
-
narrow: ["1", "2", "3", "4"],
|
|
215
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
216
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
217
|
-
};
|
|
218
|
-
var monthValues = {
|
|
219
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
220
|
-
abbreviated: [
|
|
221
|
-
"Jan",
|
|
222
|
-
"Feb",
|
|
223
|
-
"Mar",
|
|
224
|
-
"Apr",
|
|
225
|
-
"May",
|
|
226
|
-
"Jun",
|
|
227
|
-
"Jul",
|
|
228
|
-
"Aug",
|
|
229
|
-
"Sep",
|
|
230
|
-
"Oct",
|
|
231
|
-
"Nov",
|
|
232
|
-
"Dec"
|
|
233
|
-
],
|
|
234
|
-
wide: [
|
|
235
|
-
"January",
|
|
236
|
-
"February",
|
|
237
|
-
"March",
|
|
238
|
-
"April",
|
|
239
|
-
"May",
|
|
240
|
-
"June",
|
|
241
|
-
"July",
|
|
242
|
-
"August",
|
|
243
|
-
"September",
|
|
244
|
-
"October",
|
|
245
|
-
"November",
|
|
246
|
-
"December"
|
|
247
|
-
]
|
|
248
|
-
};
|
|
249
|
-
var dayValues = {
|
|
250
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
251
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
252
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
253
|
-
wide: [
|
|
254
|
-
"Sunday",
|
|
255
|
-
"Monday",
|
|
256
|
-
"Tuesday",
|
|
257
|
-
"Wednesday",
|
|
258
|
-
"Thursday",
|
|
259
|
-
"Friday",
|
|
260
|
-
"Saturday"
|
|
261
|
-
]
|
|
262
|
-
};
|
|
263
|
-
var dayPeriodValues = {
|
|
264
|
-
narrow: {
|
|
265
|
-
am: "a",
|
|
266
|
-
pm: "p",
|
|
267
|
-
midnight: "mi",
|
|
268
|
-
noon: "n",
|
|
269
|
-
morning: "morning",
|
|
270
|
-
afternoon: "afternoon",
|
|
271
|
-
evening: "evening",
|
|
272
|
-
night: "night"
|
|
273
|
-
},
|
|
274
|
-
abbreviated: {
|
|
275
|
-
am: "AM",
|
|
276
|
-
pm: "PM",
|
|
277
|
-
midnight: "midnight",
|
|
278
|
-
noon: "noon",
|
|
279
|
-
morning: "morning",
|
|
280
|
-
afternoon: "afternoon",
|
|
281
|
-
evening: "evening",
|
|
282
|
-
night: "night"
|
|
283
|
-
},
|
|
284
|
-
wide: {
|
|
285
|
-
am: "a.m.",
|
|
286
|
-
pm: "p.m.",
|
|
287
|
-
midnight: "midnight",
|
|
288
|
-
noon: "noon",
|
|
289
|
-
morning: "morning",
|
|
290
|
-
afternoon: "afternoon",
|
|
291
|
-
evening: "evening",
|
|
292
|
-
night: "night"
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
var formattingDayPeriodValues = {
|
|
296
|
-
narrow: {
|
|
297
|
-
am: "a",
|
|
298
|
-
pm: "p",
|
|
299
|
-
midnight: "mi",
|
|
300
|
-
noon: "n",
|
|
301
|
-
morning: "in the morning",
|
|
302
|
-
afternoon: "in the afternoon",
|
|
303
|
-
evening: "in the evening",
|
|
304
|
-
night: "at night"
|
|
305
|
-
},
|
|
306
|
-
abbreviated: {
|
|
307
|
-
am: "AM",
|
|
308
|
-
pm: "PM",
|
|
309
|
-
midnight: "midnight",
|
|
310
|
-
noon: "noon",
|
|
311
|
-
morning: "in the morning",
|
|
312
|
-
afternoon: "in the afternoon",
|
|
313
|
-
evening: "in the evening",
|
|
314
|
-
night: "at night"
|
|
315
|
-
},
|
|
316
|
-
wide: {
|
|
317
|
-
am: "a.m.",
|
|
318
|
-
pm: "p.m.",
|
|
319
|
-
midnight: "midnight",
|
|
320
|
-
noon: "noon",
|
|
321
|
-
morning: "in the morning",
|
|
322
|
-
afternoon: "in the afternoon",
|
|
323
|
-
evening: "in the evening",
|
|
324
|
-
night: "at night"
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
var ordinalNumber = (dirtyNumber, _options) => {
|
|
328
|
-
const number = Number(dirtyNumber);
|
|
329
|
-
const rem100 = number % 100;
|
|
330
|
-
if (rem100 > 20 || rem100 < 10) {
|
|
331
|
-
switch (rem100 % 10) {
|
|
332
|
-
case 1:
|
|
333
|
-
return number + "st";
|
|
334
|
-
case 2:
|
|
335
|
-
return number + "nd";
|
|
336
|
-
case 3:
|
|
337
|
-
return number + "rd";
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
return number + "th";
|
|
341
|
-
};
|
|
342
|
-
var localize = {
|
|
343
|
-
ordinalNumber,
|
|
344
|
-
era: buildLocalizeFn({
|
|
345
|
-
values: eraValues,
|
|
346
|
-
defaultWidth: "wide"
|
|
347
|
-
}),
|
|
348
|
-
quarter: buildLocalizeFn({
|
|
349
|
-
values: quarterValues,
|
|
350
|
-
defaultWidth: "wide",
|
|
351
|
-
argumentCallback: (quarter) => quarter - 1
|
|
352
|
-
}),
|
|
353
|
-
month: buildLocalizeFn({
|
|
354
|
-
values: monthValues,
|
|
355
|
-
defaultWidth: "wide"
|
|
356
|
-
}),
|
|
357
|
-
day: buildLocalizeFn({
|
|
358
|
-
values: dayValues,
|
|
359
|
-
defaultWidth: "wide"
|
|
360
|
-
}),
|
|
361
|
-
dayPeriod: buildLocalizeFn({
|
|
362
|
-
values: dayPeriodValues,
|
|
363
|
-
defaultWidth: "wide",
|
|
364
|
-
formattingValues: formattingDayPeriodValues,
|
|
365
|
-
defaultFormattingWidth: "wide"
|
|
366
|
-
})
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
370
|
-
function buildMatchFn(args) {
|
|
371
|
-
return (string, options = {}) => {
|
|
372
|
-
const width = options.width;
|
|
373
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
374
|
-
const matchResult = string.match(matchPattern);
|
|
375
|
-
if (!matchResult) {
|
|
376
|
-
return null;
|
|
377
|
-
}
|
|
378
|
-
const matchedString = matchResult[0];
|
|
379
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
380
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
381
|
-
// [TODO] -- I challenge you to fix the type
|
|
382
|
-
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
383
|
-
);
|
|
384
|
-
let value;
|
|
385
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
386
|
-
value = options.valueCallback ? (
|
|
387
|
-
// [TODO] -- I challenge you to fix the type
|
|
388
|
-
options.valueCallback(value)
|
|
389
|
-
) : value;
|
|
390
|
-
const rest = string.slice(matchedString.length);
|
|
391
|
-
return { value, rest };
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
function findKey(object, predicate) {
|
|
395
|
-
for (const key in object) {
|
|
396
|
-
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
397
|
-
return key;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
return void 0;
|
|
401
|
-
}
|
|
402
|
-
function findIndex(array, predicate) {
|
|
403
|
-
for (let key = 0; key < array.length; key++) {
|
|
404
|
-
if (predicate(array[key])) {
|
|
405
|
-
return key;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return void 0;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
412
|
-
function buildMatchPatternFn(args) {
|
|
413
|
-
return (string, options = {}) => {
|
|
414
|
-
const matchResult = string.match(args.matchPattern);
|
|
415
|
-
if (!matchResult) return null;
|
|
416
|
-
const matchedString = matchResult[0];
|
|
417
|
-
const parseResult = string.match(args.parsePattern);
|
|
418
|
-
if (!parseResult) return null;
|
|
419
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
420
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
421
|
-
const rest = string.slice(matchedString.length);
|
|
422
|
-
return { value, rest };
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js
|
|
427
|
-
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
428
|
-
var parseOrdinalNumberPattern = /\d+/i;
|
|
429
|
-
var matchEraPatterns = {
|
|
430
|
-
narrow: /^(b|a)/i,
|
|
431
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
432
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
433
|
-
};
|
|
434
|
-
var parseEraPatterns = {
|
|
435
|
-
any: [/^b/i, /^(a|c)/i]
|
|
436
|
-
};
|
|
437
|
-
var matchQuarterPatterns = {
|
|
438
|
-
narrow: /^[1234]/i,
|
|
439
|
-
abbreviated: /^q[1234]/i,
|
|
440
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
441
|
-
};
|
|
442
|
-
var parseQuarterPatterns = {
|
|
443
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
444
|
-
};
|
|
445
|
-
var matchMonthPatterns = {
|
|
446
|
-
narrow: /^[jfmasond]/i,
|
|
447
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
448
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
449
|
-
};
|
|
450
|
-
var parseMonthPatterns = {
|
|
451
|
-
narrow: [
|
|
452
|
-
/^j/i,
|
|
453
|
-
/^f/i,
|
|
454
|
-
/^m/i,
|
|
455
|
-
/^a/i,
|
|
456
|
-
/^m/i,
|
|
457
|
-
/^j/i,
|
|
458
|
-
/^j/i,
|
|
459
|
-
/^a/i,
|
|
460
|
-
/^s/i,
|
|
461
|
-
/^o/i,
|
|
462
|
-
/^n/i,
|
|
463
|
-
/^d/i
|
|
464
|
-
],
|
|
465
|
-
any: [
|
|
466
|
-
/^ja/i,
|
|
467
|
-
/^f/i,
|
|
468
|
-
/^mar/i,
|
|
469
|
-
/^ap/i,
|
|
470
|
-
/^may/i,
|
|
471
|
-
/^jun/i,
|
|
472
|
-
/^jul/i,
|
|
473
|
-
/^au/i,
|
|
474
|
-
/^s/i,
|
|
475
|
-
/^o/i,
|
|
476
|
-
/^n/i,
|
|
477
|
-
/^d/i
|
|
478
|
-
]
|
|
479
|
-
};
|
|
480
|
-
var matchDayPatterns = {
|
|
481
|
-
narrow: /^[smtwf]/i,
|
|
482
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
483
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
484
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
485
|
-
};
|
|
486
|
-
var parseDayPatterns = {
|
|
487
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
488
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
489
|
-
};
|
|
490
|
-
var matchDayPeriodPatterns = {
|
|
491
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
492
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
493
|
-
};
|
|
494
|
-
var parseDayPeriodPatterns = {
|
|
495
|
-
any: {
|
|
496
|
-
am: /^a/i,
|
|
497
|
-
pm: /^p/i,
|
|
498
|
-
midnight: /^mi/i,
|
|
499
|
-
noon: /^no/i,
|
|
500
|
-
morning: /morning/i,
|
|
501
|
-
afternoon: /afternoon/i,
|
|
502
|
-
evening: /evening/i,
|
|
503
|
-
night: /night/i
|
|
504
|
-
}
|
|
505
|
-
};
|
|
506
|
-
var match = {
|
|
507
|
-
ordinalNumber: buildMatchPatternFn({
|
|
508
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
509
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
510
|
-
valueCallback: (value) => parseInt(value, 10)
|
|
511
|
-
}),
|
|
512
|
-
era: buildMatchFn({
|
|
513
|
-
matchPatterns: matchEraPatterns,
|
|
514
|
-
defaultMatchWidth: "wide",
|
|
515
|
-
parsePatterns: parseEraPatterns,
|
|
516
|
-
defaultParseWidth: "any"
|
|
517
|
-
}),
|
|
518
|
-
quarter: buildMatchFn({
|
|
519
|
-
matchPatterns: matchQuarterPatterns,
|
|
520
|
-
defaultMatchWidth: "wide",
|
|
521
|
-
parsePatterns: parseQuarterPatterns,
|
|
522
|
-
defaultParseWidth: "any",
|
|
523
|
-
valueCallback: (index) => index + 1
|
|
524
|
-
}),
|
|
525
|
-
month: buildMatchFn({
|
|
526
|
-
matchPatterns: matchMonthPatterns,
|
|
527
|
-
defaultMatchWidth: "wide",
|
|
528
|
-
parsePatterns: parseMonthPatterns,
|
|
529
|
-
defaultParseWidth: "any"
|
|
530
|
-
}),
|
|
531
|
-
day: buildMatchFn({
|
|
532
|
-
matchPatterns: matchDayPatterns,
|
|
533
|
-
defaultMatchWidth: "wide",
|
|
534
|
-
parsePatterns: parseDayPatterns,
|
|
535
|
-
defaultParseWidth: "any"
|
|
536
|
-
}),
|
|
537
|
-
dayPeriod: buildMatchFn({
|
|
538
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
539
|
-
defaultMatchWidth: "any",
|
|
540
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
541
|
-
defaultParseWidth: "any"
|
|
542
|
-
})
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js
|
|
546
|
-
var enUS = {
|
|
547
|
-
code: "en-US",
|
|
548
|
-
formatDistance,
|
|
549
|
-
formatLong,
|
|
550
|
-
formatRelative,
|
|
551
|
-
localize,
|
|
552
|
-
match,
|
|
553
|
-
options: {
|
|
554
|
-
weekStartsOn: 0,
|
|
555
|
-
firstWeekContainsDate: 1
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js
|
|
560
|
-
var defaultOptions = {};
|
|
561
|
-
function getDefaultOptions() {
|
|
562
|
-
return defaultOptions;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js
|
|
566
|
-
function toDate(argument, context) {
|
|
567
|
-
return constructFrom(context || argument, argument);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
571
|
-
function getTimezoneOffsetInMilliseconds(date) {
|
|
572
|
-
const _date = toDate(date);
|
|
573
|
-
const utcDate = new Date(
|
|
574
|
-
Date.UTC(
|
|
575
|
-
_date.getFullYear(),
|
|
576
|
-
_date.getMonth(),
|
|
577
|
-
_date.getDate(),
|
|
578
|
-
_date.getHours(),
|
|
579
|
-
_date.getMinutes(),
|
|
580
|
-
_date.getSeconds(),
|
|
581
|
-
_date.getMilliseconds()
|
|
582
|
-
)
|
|
583
|
-
);
|
|
584
|
-
utcDate.setUTCFullYear(_date.getFullYear());
|
|
585
|
-
return +date - +utcDate;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js
|
|
589
|
-
function normalizeDates(context, ...dates) {
|
|
590
|
-
const normalize = constructFrom.bind(
|
|
591
|
-
null,
|
|
592
|
-
context || dates.find((date) => typeof date === "object")
|
|
593
|
-
);
|
|
594
|
-
return dates.map(normalize);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/compareAsc.js
|
|
598
|
-
function compareAsc(dateLeft, dateRight) {
|
|
599
|
-
const diff = +toDate(dateLeft) - +toDate(dateRight);
|
|
600
|
-
if (diff < 0) return -1;
|
|
601
|
-
else if (diff > 0) return 1;
|
|
602
|
-
return diff;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarMonths.js
|
|
606
|
-
function differenceInCalendarMonths(laterDate, earlierDate, options) {
|
|
607
|
-
const [laterDate_, earlierDate_] = normalizeDates(
|
|
608
|
-
options?.in,
|
|
609
|
-
laterDate,
|
|
610
|
-
earlierDate
|
|
611
|
-
);
|
|
612
|
-
const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
|
|
613
|
-
const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
|
|
614
|
-
return yearsDiff * 12 + monthsDiff;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfDay.js
|
|
618
|
-
function endOfDay(date, options) {
|
|
619
|
-
const _date = toDate(date, options?.in);
|
|
620
|
-
_date.setHours(23, 59, 59, 999);
|
|
621
|
-
return _date;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfMonth.js
|
|
625
|
-
function endOfMonth(date, options) {
|
|
626
|
-
const _date = toDate(date, options?.in);
|
|
627
|
-
const month = _date.getMonth();
|
|
628
|
-
_date.setFullYear(_date.getFullYear(), month + 1, 0);
|
|
629
|
-
_date.setHours(23, 59, 59, 999);
|
|
630
|
-
return _date;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isLastDayOfMonth.js
|
|
634
|
-
function isLastDayOfMonth(date, options) {
|
|
635
|
-
const _date = toDate(date, options?.in);
|
|
636
|
-
return +endOfDay(_date, options) === +endOfMonth(_date, options);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMonths.js
|
|
640
|
-
function differenceInMonths(laterDate, earlierDate, options) {
|
|
641
|
-
const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
|
|
642
|
-
options?.in,
|
|
643
|
-
laterDate,
|
|
644
|
-
laterDate,
|
|
645
|
-
earlierDate
|
|
646
|
-
);
|
|
647
|
-
const sign = compareAsc(workingLaterDate, earlierDate_);
|
|
648
|
-
const difference = Math.abs(
|
|
649
|
-
differenceInCalendarMonths(workingLaterDate, earlierDate_)
|
|
650
|
-
);
|
|
651
|
-
if (difference < 1) return 0;
|
|
652
|
-
if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
|
|
653
|
-
workingLaterDate.setDate(30);
|
|
654
|
-
workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
|
|
655
|
-
let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
|
|
656
|
-
if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
|
|
657
|
-
isLastMonthNotFull = false;
|
|
658
|
-
}
|
|
659
|
-
const result = sign * (difference - +isLastMonthNotFull);
|
|
660
|
-
return result === 0 ? 0 : result;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getRoundingMethod.js
|
|
664
|
-
function getRoundingMethod(method) {
|
|
665
|
-
return (number) => {
|
|
666
|
-
const round = method ? Math[method] : Math.trunc;
|
|
667
|
-
const result = round(number);
|
|
668
|
-
return result === 0 ? 0 : result;
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInMilliseconds.js
|
|
673
|
-
function differenceInMilliseconds(laterDate, earlierDate) {
|
|
674
|
-
return +toDate(laterDate) - +toDate(earlierDate);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInSeconds.js
|
|
678
|
-
function differenceInSeconds(laterDate, earlierDate, options) {
|
|
679
|
-
const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
|
|
680
|
-
return getRoundingMethod(options?.roundingMethod)(diff);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/formatDistance.js
|
|
684
|
-
function formatDistance2(laterDate, earlierDate, options) {
|
|
685
|
-
const defaultOptions2 = getDefaultOptions();
|
|
686
|
-
const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
|
|
687
|
-
const minutesInAlmostTwoDays = 2520;
|
|
688
|
-
const comparison = compareAsc(laterDate, earlierDate);
|
|
689
|
-
if (isNaN(comparison)) throw new RangeError("Invalid time value");
|
|
690
|
-
const localizeOptions = Object.assign({}, options, {
|
|
691
|
-
addSuffix: options?.addSuffix,
|
|
692
|
-
comparison
|
|
693
|
-
});
|
|
694
|
-
const [laterDate_, earlierDate_] = normalizeDates(
|
|
695
|
-
options?.in,
|
|
696
|
-
...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
|
|
697
|
-
);
|
|
698
|
-
const seconds = differenceInSeconds(earlierDate_, laterDate_);
|
|
699
|
-
const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
|
|
700
|
-
const minutes = Math.round((seconds - offsetInSeconds) / 60);
|
|
701
|
-
let months;
|
|
702
|
-
if (minutes < 2) {
|
|
703
|
-
if (options?.includeSeconds) {
|
|
704
|
-
if (seconds < 5) {
|
|
705
|
-
return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
|
|
706
|
-
} else if (seconds < 10) {
|
|
707
|
-
return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
|
|
708
|
-
} else if (seconds < 20) {
|
|
709
|
-
return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
|
|
710
|
-
} else if (seconds < 40) {
|
|
711
|
-
return locale.formatDistance("halfAMinute", 0, localizeOptions);
|
|
712
|
-
} else if (seconds < 60) {
|
|
713
|
-
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
|
714
|
-
} else {
|
|
715
|
-
return locale.formatDistance("xMinutes", 1, localizeOptions);
|
|
716
|
-
}
|
|
717
|
-
} else {
|
|
718
|
-
if (minutes === 0) {
|
|
719
|
-
return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
|
|
720
|
-
} else {
|
|
721
|
-
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
} else if (minutes < 45) {
|
|
725
|
-
return locale.formatDistance("xMinutes", minutes, localizeOptions);
|
|
726
|
-
} else if (minutes < 90) {
|
|
727
|
-
return locale.formatDistance("aboutXHours", 1, localizeOptions);
|
|
728
|
-
} else if (minutes < minutesInDay) {
|
|
729
|
-
const hours = Math.round(minutes / 60);
|
|
730
|
-
return locale.formatDistance("aboutXHours", hours, localizeOptions);
|
|
731
|
-
} else if (minutes < minutesInAlmostTwoDays) {
|
|
732
|
-
return locale.formatDistance("xDays", 1, localizeOptions);
|
|
733
|
-
} else if (minutes < minutesInMonth) {
|
|
734
|
-
const days = Math.round(minutes / minutesInDay);
|
|
735
|
-
return locale.formatDistance("xDays", days, localizeOptions);
|
|
736
|
-
} else if (minutes < minutesInMonth * 2) {
|
|
737
|
-
months = Math.round(minutes / minutesInMonth);
|
|
738
|
-
return locale.formatDistance("aboutXMonths", months, localizeOptions);
|
|
739
|
-
}
|
|
740
|
-
months = differenceInMonths(earlierDate_, laterDate_);
|
|
741
|
-
if (months < 12) {
|
|
742
|
-
const nearestMonth = Math.round(minutes / minutesInMonth);
|
|
743
|
-
return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
|
|
744
|
-
} else {
|
|
745
|
-
const monthsSinceStartOfYear = months % 12;
|
|
746
|
-
const years = Math.trunc(months / 12);
|
|
747
|
-
if (monthsSinceStartOfYear < 3) {
|
|
748
|
-
return locale.formatDistance("aboutXYears", years, localizeOptions);
|
|
749
|
-
} else if (monthsSinceStartOfYear < 9) {
|
|
750
|
-
return locale.formatDistance("overXYears", years, localizeOptions);
|
|
751
|
-
} else {
|
|
752
|
-
return locale.formatDistance("almostXYears", years + 1, localizeOptions);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/formatDistanceToNow.js
|
|
758
|
-
function formatDistanceToNow(date, options) {
|
|
759
|
-
return formatDistance2(date, constructNow(date), options);
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
// src/logger/console.ts
|
|
763
|
-
var getLogFn = (logLevel = LogLevel.INFO, config = {}, options = {}) => {
|
|
764
|
-
const {
|
|
765
|
-
chalk: _chalk = getChalk(),
|
|
766
|
-
fullDateTime = false,
|
|
767
|
-
hideDateTime = false
|
|
768
|
-
} = options;
|
|
769
|
-
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
770
|
-
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
771
|
-
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
772
|
-
return (_) => {
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
776
|
-
return (message) => {
|
|
777
|
-
console.error(
|
|
778
|
-
`
|
|
779
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
|
|
780
|
-
`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
|
|
781
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
782
|
-
`
|
|
783
|
-
);
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
787
|
-
return (message) => {
|
|
788
|
-
console.error(
|
|
789
|
-
`
|
|
790
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
|
|
791
|
-
`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
|
|
792
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
793
|
-
`
|
|
794
|
-
);
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
798
|
-
return (message) => {
|
|
799
|
-
console.warn(
|
|
800
|
-
`
|
|
801
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
|
|
802
|
-
`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
|
|
803
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
804
|
-
`
|
|
805
|
-
);
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
809
|
-
return (message) => {
|
|
810
|
-
console.info(
|
|
811
|
-
`
|
|
812
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
|
|
813
|
-
`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
|
|
814
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
815
|
-
`
|
|
816
|
-
);
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
820
|
-
return (message) => {
|
|
821
|
-
console.info(
|
|
822
|
-
`
|
|
823
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
|
|
824
|
-
`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
|
|
825
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
826
|
-
`
|
|
827
|
-
);
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) {
|
|
831
|
-
return (message) => {
|
|
832
|
-
console.debug(
|
|
833
|
-
`
|
|
834
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
|
|
835
|
-
`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
|
|
836
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
837
|
-
`
|
|
838
|
-
);
|
|
839
|
-
};
|
|
840
|
-
}
|
|
841
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
842
|
-
return (message) => {
|
|
843
|
-
console.debug(
|
|
844
|
-
`
|
|
845
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
|
|
846
|
-
`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
|
|
847
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
848
|
-
`
|
|
849
|
-
);
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
853
|
-
return (message) => {
|
|
854
|
-
console.debug(
|
|
855
|
-
`
|
|
856
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
|
|
857
|
-
`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
|
|
858
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
859
|
-
`
|
|
860
|
-
);
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
return (message) => {
|
|
864
|
-
console.log(
|
|
865
|
-
`
|
|
866
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
|
|
867
|
-
`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
|
|
868
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
869
|
-
`
|
|
870
|
-
);
|
|
871
|
-
};
|
|
872
|
-
};
|
|
873
|
-
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
874
|
-
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
875
|
-
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
876
|
-
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
877
|
-
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
878
|
-
var writePerformance = (message, config) => getLogFn(LogLevel.PERFORMANCE, config)(message);
|
|
879
|
-
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
880
|
-
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
881
|
-
var writeSystem = (message, config) => getLogFn(LogLevel.ALL, config)(message);
|
|
882
|
-
var getStopwatch = (name) => {
|
|
883
|
-
const start = /* @__PURE__ */ new Date();
|
|
884
|
-
return () => {
|
|
885
|
-
writePerformance(
|
|
886
|
-
`The${name ? ` ${name}` : ""} process took ${formatDistanceToNow(start, {
|
|
887
|
-
includeSeconds: true
|
|
888
|
-
})} to complete`
|
|
889
|
-
);
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
|
-
var MAX_DEPTH = 10;
|
|
893
|
-
var formatLogMessage = (message, options = {}, depth = 0) => {
|
|
894
|
-
if (depth > MAX_DEPTH) {
|
|
895
|
-
return "<max depth>";
|
|
896
|
-
}
|
|
897
|
-
const prefix = options.prefix ?? "";
|
|
898
|
-
const skip = options.skip ?? [];
|
|
899
|
-
const sort = options.sort ?? true;
|
|
900
|
-
return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
|
|
901
|
-
${message.sort(
|
|
902
|
-
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
903
|
-
).map(
|
|
904
|
-
(item, index) => ` ${prefix}> #${index} = ${formatLogMessage(
|
|
905
|
-
item,
|
|
906
|
-
{ prefix: `${prefix}--`, skip, sort },
|
|
907
|
-
depth + 1
|
|
908
|
-
)}`
|
|
909
|
-
).join("\n")}` : typeof message === "object" && message ? `
|
|
910
|
-
${Object.keys(message).filter(
|
|
911
|
-
(key) => typeof key !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key.toLowerCase().trim())
|
|
912
|
-
).sort(
|
|
913
|
-
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
914
|
-
).map(
|
|
915
|
-
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" && message[key] ? Object.keys(message[key]).filter(
|
|
916
|
-
(key2) => typeof key2 !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key2.toLowerCase().trim())
|
|
917
|
-
).length === 0 ? "{}" : formatLogMessage(
|
|
918
|
-
message[key],
|
|
919
|
-
{ prefix: `${prefix}--`, skip, sort },
|
|
920
|
-
depth + 1
|
|
921
|
-
) : message[key]}`
|
|
922
|
-
).join("\n")}` : String(message);
|
|
923
|
-
};
|
|
924
|
-
var _isFunction = (value) => {
|
|
925
|
-
try {
|
|
926
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
927
|
-
} catch {
|
|
928
|
-
return false;
|
|
929
|
-
}
|
|
930
|
-
};
|
|
931
|
-
var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("\u{1F5F2}");
|
|
932
|
-
|
|
933
|
-
export {
|
|
934
|
-
getLogFn,
|
|
935
|
-
writeFatal,
|
|
936
|
-
writeError,
|
|
937
|
-
writeWarning,
|
|
938
|
-
writeInfo,
|
|
939
|
-
writeSuccess,
|
|
940
|
-
writePerformance,
|
|
941
|
-
writeDebug,
|
|
942
|
-
writeTrace,
|
|
943
|
-
writeSystem,
|
|
944
|
-
getStopwatch,
|
|
945
|
-
formatLogMessage,
|
|
946
|
-
brandIcon
|
|
947
|
-
};
|