@likec4/log 1.21.1 → 1.22.0
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 +34 -1
- package/dist/index.cjs +157 -1528
- package/dist/index.d.cts +17 -464
- package/dist/index.d.mts +17 -464
- package/dist/index.d.ts +17 -464
- package/dist/index.mjs +146 -1507
- package/package.json +7 -17
- package/src/formatters.ts +194 -0
- package/src/index.ts +80 -32
- package/src/utils.ts +37 -0
- package/dist/browser.cjs +0 -1938
- package/dist/browser.mjs +0 -1932
- package/dist/chunks/prompt.cjs +0 -288
- package/dist/chunks/prompt.mjs +0 -280
- package/src/browser.ts +0 -16
- package/src/format.ts +0 -60
package/dist/index.mjs
CHANGED
|
@@ -1,1455 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { sep } from 'node:path';
|
|
3
|
-
import p$1, { cwd } from 'node:process';
|
|
4
|
-
import * as tty from 'node:tty';
|
|
5
|
-
|
|
6
|
-
const LogLevels = {
|
|
7
|
-
silent: Number.NEGATIVE_INFINITY,
|
|
8
|
-
fatal: 0,
|
|
9
|
-
error: 0,
|
|
10
|
-
warn: 1,
|
|
11
|
-
log: 2,
|
|
12
|
-
info: 3,
|
|
13
|
-
success: 3,
|
|
14
|
-
fail: 3,
|
|
15
|
-
ready: 3,
|
|
16
|
-
start: 3,
|
|
17
|
-
box: 3,
|
|
18
|
-
debug: 4,
|
|
19
|
-
trace: 5,
|
|
20
|
-
verbose: Number.POSITIVE_INFINITY
|
|
21
|
-
};
|
|
22
|
-
const LogTypes = {
|
|
23
|
-
// Silent
|
|
24
|
-
silent: {
|
|
25
|
-
level: -1
|
|
26
|
-
},
|
|
27
|
-
// Level 0
|
|
28
|
-
fatal: {
|
|
29
|
-
level: LogLevels.fatal
|
|
30
|
-
},
|
|
31
|
-
error: {
|
|
32
|
-
level: LogLevels.error
|
|
33
|
-
},
|
|
34
|
-
// Level 1
|
|
35
|
-
warn: {
|
|
36
|
-
level: LogLevels.warn
|
|
37
|
-
},
|
|
38
|
-
// Level 2
|
|
39
|
-
log: {
|
|
40
|
-
level: LogLevels.log
|
|
41
|
-
},
|
|
42
|
-
// Level 3
|
|
43
|
-
info: {
|
|
44
|
-
level: LogLevels.info
|
|
45
|
-
},
|
|
46
|
-
success: {
|
|
47
|
-
level: LogLevels.success
|
|
48
|
-
},
|
|
49
|
-
fail: {
|
|
50
|
-
level: LogLevels.fail
|
|
51
|
-
},
|
|
52
|
-
ready: {
|
|
53
|
-
level: LogLevels.info
|
|
54
|
-
},
|
|
55
|
-
start: {
|
|
56
|
-
level: LogLevels.info
|
|
57
|
-
},
|
|
58
|
-
box: {
|
|
59
|
-
level: LogLevels.info
|
|
60
|
-
},
|
|
61
|
-
// Level 4
|
|
62
|
-
debug: {
|
|
63
|
-
level: LogLevels.debug
|
|
64
|
-
},
|
|
65
|
-
// Level 5
|
|
66
|
-
trace: {
|
|
67
|
-
level: LogLevels.trace
|
|
68
|
-
},
|
|
69
|
-
// Verbose
|
|
70
|
-
verbose: {
|
|
71
|
-
level: LogLevels.verbose
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
function isPlainObject$1(value) {
|
|
76
|
-
if (value === null || typeof value !== "object") {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
const prototype = Object.getPrototypeOf(value);
|
|
80
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
if (Symbol.iterator in value) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
if (Symbol.toStringTag in value) {
|
|
87
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
93
|
-
if (!isPlainObject$1(defaults)) {
|
|
94
|
-
return _defu(baseObject, {}, namespace);
|
|
95
|
-
}
|
|
96
|
-
const object = Object.assign({}, defaults);
|
|
97
|
-
for (const key in baseObject) {
|
|
98
|
-
if (key === "__proto__" || key === "constructor") {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
const value = baseObject[key];
|
|
102
|
-
if (value === null || value === undefined) {
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
106
|
-
object[key] = [...value, ...object[key]];
|
|
107
|
-
} else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
|
|
108
|
-
object[key] = _defu(
|
|
109
|
-
value,
|
|
110
|
-
object[key],
|
|
111
|
-
(namespace ? `${namespace}.` : "") + key.toString());
|
|
112
|
-
} else {
|
|
113
|
-
object[key] = value;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return object;
|
|
117
|
-
}
|
|
118
|
-
function createDefu(merger) {
|
|
119
|
-
return (...arguments_) => (
|
|
120
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
121
|
-
arguments_.reduce((p, c) => _defu(p, c, ""), {})
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
const defu = createDefu();
|
|
125
|
-
|
|
126
|
-
function isPlainObject$2(obj) {
|
|
127
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
128
|
-
}
|
|
129
|
-
function isLogObj(arg) {
|
|
130
|
-
if (!isPlainObject$2(arg)) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
if (!arg.message && !arg.args) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
if (arg.stack) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
let paused = false;
|
|
143
|
-
const queue = [];
|
|
144
|
-
class Consola {
|
|
145
|
-
options;
|
|
146
|
-
_lastLog;
|
|
147
|
-
_mockFn;
|
|
148
|
-
/**
|
|
149
|
-
* Creates an instance of Consola with specified options or defaults.
|
|
150
|
-
*
|
|
151
|
-
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
152
|
-
*/
|
|
153
|
-
constructor(options = {}) {
|
|
154
|
-
const types = options.types || LogTypes;
|
|
155
|
-
this.options = defu(
|
|
156
|
-
{
|
|
157
|
-
...options,
|
|
158
|
-
defaults: { ...options.defaults },
|
|
159
|
-
level: _normalizeLogLevel(options.level, types),
|
|
160
|
-
reporters: [...options.reporters || []]
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
types: LogTypes,
|
|
164
|
-
throttle: 1e3,
|
|
165
|
-
throttleMin: 5,
|
|
166
|
-
formatOptions: {
|
|
167
|
-
date: true,
|
|
168
|
-
colors: false,
|
|
169
|
-
compact: true
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
for (const type in types) {
|
|
174
|
-
const defaults = {
|
|
175
|
-
type,
|
|
176
|
-
...this.options.defaults,
|
|
177
|
-
...types[type]
|
|
178
|
-
};
|
|
179
|
-
this[type] = this._wrapLogFn(defaults);
|
|
180
|
-
this[type].raw = this._wrapLogFn(
|
|
181
|
-
defaults,
|
|
182
|
-
true
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
if (this.options.mockFn) {
|
|
186
|
-
this.mockTypes();
|
|
187
|
-
}
|
|
188
|
-
this._lastLog = {};
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Gets the current log level of the Consola instance.
|
|
192
|
-
*
|
|
193
|
-
* @returns {number} The current log level.
|
|
194
|
-
*/
|
|
195
|
-
get level() {
|
|
196
|
-
return this.options.level;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Sets the minimum log level that will be output by the instance.
|
|
200
|
-
*
|
|
201
|
-
* @param {number} level - The new log level to set.
|
|
202
|
-
*/
|
|
203
|
-
set level(level) {
|
|
204
|
-
this.options.level = _normalizeLogLevel(
|
|
205
|
-
level,
|
|
206
|
-
this.options.types,
|
|
207
|
-
this.options.level
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Displays a prompt to the user and returns the response.
|
|
212
|
-
* Throw an error if `prompt` is not supported by the current configuration.
|
|
213
|
-
*
|
|
214
|
-
* @template T
|
|
215
|
-
* @param {string} message - The message to display in the prompt.
|
|
216
|
-
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
217
|
-
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
218
|
-
*/
|
|
219
|
-
prompt(message, opts) {
|
|
220
|
-
if (!this.options.prompt) {
|
|
221
|
-
throw new Error("prompt is not supported!");
|
|
222
|
-
}
|
|
223
|
-
return this.options.prompt(message, opts);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
227
|
-
*
|
|
228
|
-
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
229
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
230
|
-
*/
|
|
231
|
-
create(options) {
|
|
232
|
-
const instance = new Consola({
|
|
233
|
-
...this.options,
|
|
234
|
-
...options
|
|
235
|
-
});
|
|
236
|
-
if (this._mockFn) {
|
|
237
|
-
instance.mockTypes(this._mockFn);
|
|
238
|
-
}
|
|
239
|
-
return instance;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Creates a new Consola instance with the specified default log object properties.
|
|
243
|
-
*
|
|
244
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
245
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
246
|
-
*/
|
|
247
|
-
withDefaults(defaults) {
|
|
248
|
-
return this.create({
|
|
249
|
-
...this.options,
|
|
250
|
-
defaults: {
|
|
251
|
-
...this.options.defaults,
|
|
252
|
-
...defaults
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
258
|
-
*
|
|
259
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
260
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
261
|
-
*/
|
|
262
|
-
withTag(tag) {
|
|
263
|
-
return this.withDefaults({
|
|
264
|
-
tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Adds a custom reporter to the Consola instance.
|
|
269
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
270
|
-
*
|
|
271
|
-
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
272
|
-
* @returns {Consola} The current Consola instance.
|
|
273
|
-
*/
|
|
274
|
-
addReporter(reporter) {
|
|
275
|
-
this.options.reporters.push(reporter);
|
|
276
|
-
return this;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Removes a custom reporter from the Consola instance.
|
|
280
|
-
* If no reporter is specified, all reporters will be removed.
|
|
281
|
-
*
|
|
282
|
-
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
283
|
-
* @returns {Consola} The current Consola instance.
|
|
284
|
-
*/
|
|
285
|
-
removeReporter(reporter) {
|
|
286
|
-
if (reporter) {
|
|
287
|
-
const i = this.options.reporters.indexOf(reporter);
|
|
288
|
-
if (i !== -1) {
|
|
289
|
-
return this.options.reporters.splice(i, 1);
|
|
290
|
-
}
|
|
291
|
-
} else {
|
|
292
|
-
this.options.reporters.splice(0);
|
|
293
|
-
}
|
|
294
|
-
return this;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
298
|
-
*
|
|
299
|
-
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
300
|
-
* @returns {Consola} The current Consola instance.
|
|
301
|
-
*/
|
|
302
|
-
setReporters(reporters) {
|
|
303
|
-
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
304
|
-
return this;
|
|
305
|
-
}
|
|
306
|
-
wrapAll() {
|
|
307
|
-
this.wrapConsole();
|
|
308
|
-
this.wrapStd();
|
|
309
|
-
}
|
|
310
|
-
restoreAll() {
|
|
311
|
-
this.restoreConsole();
|
|
312
|
-
this.restoreStd();
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Overrides console methods with Consola logging methods for consistent logging.
|
|
316
|
-
*/
|
|
317
|
-
wrapConsole() {
|
|
318
|
-
for (const type in this.options.types) {
|
|
319
|
-
if (!console["__" + type]) {
|
|
320
|
-
console["__" + type] = console[type];
|
|
321
|
-
}
|
|
322
|
-
console[type] = this[type].raw;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Restores the original console methods, removing Consola overrides.
|
|
327
|
-
*/
|
|
328
|
-
restoreConsole() {
|
|
329
|
-
for (const type in this.options.types) {
|
|
330
|
-
if (console["__" + type]) {
|
|
331
|
-
console[type] = console["__" + type];
|
|
332
|
-
delete console["__" + type];
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Overrides standard output and error streams to redirect them through Consola.
|
|
338
|
-
*/
|
|
339
|
-
wrapStd() {
|
|
340
|
-
this._wrapStream(this.options.stdout, "log");
|
|
341
|
-
this._wrapStream(this.options.stderr, "log");
|
|
342
|
-
}
|
|
343
|
-
_wrapStream(stream, type) {
|
|
344
|
-
if (!stream) {
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
if (!stream.__write) {
|
|
348
|
-
stream.__write = stream.write;
|
|
349
|
-
}
|
|
350
|
-
stream.write = (data) => {
|
|
351
|
-
this[type].raw(String(data).trim());
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
/**
|
|
355
|
-
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
356
|
-
*/
|
|
357
|
-
restoreStd() {
|
|
358
|
-
this._restoreStream(this.options.stdout);
|
|
359
|
-
this._restoreStream(this.options.stderr);
|
|
360
|
-
}
|
|
361
|
-
_restoreStream(stream) {
|
|
362
|
-
if (!stream) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (stream.__write) {
|
|
366
|
-
stream.write = stream.__write;
|
|
367
|
-
delete stream.__write;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Pauses logging, queues incoming logs until resumed.
|
|
372
|
-
*/
|
|
373
|
-
pauseLogs() {
|
|
374
|
-
paused = true;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Resumes logging, processing any queued logs.
|
|
378
|
-
*/
|
|
379
|
-
resumeLogs() {
|
|
380
|
-
paused = false;
|
|
381
|
-
const _queue = queue.splice(0);
|
|
382
|
-
for (const item of _queue) {
|
|
383
|
-
item[0]._logFn(item[1], item[2]);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
388
|
-
*
|
|
389
|
-
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
390
|
-
*/
|
|
391
|
-
mockTypes(mockFn) {
|
|
392
|
-
const _mockFn = mockFn || this.options.mockFn;
|
|
393
|
-
this._mockFn = _mockFn;
|
|
394
|
-
if (typeof _mockFn !== "function") {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
for (const type in this.options.types) {
|
|
398
|
-
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
399
|
-
this[type].raw = this[type];
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
_wrapLogFn(defaults, isRaw) {
|
|
403
|
-
return (...args) => {
|
|
404
|
-
if (paused) {
|
|
405
|
-
queue.push([this, defaults, args, isRaw]);
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
return this._logFn(defaults, args, isRaw);
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
_logFn(defaults, args, isRaw) {
|
|
412
|
-
if ((defaults.level || 0) > this.level) {
|
|
413
|
-
return false;
|
|
414
|
-
}
|
|
415
|
-
const logObj = {
|
|
416
|
-
date: /* @__PURE__ */ new Date(),
|
|
417
|
-
args: [],
|
|
418
|
-
...defaults,
|
|
419
|
-
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
420
|
-
};
|
|
421
|
-
if (!isRaw && args.length === 1 && isLogObj(args[0])) {
|
|
422
|
-
Object.assign(logObj, args[0]);
|
|
423
|
-
} else {
|
|
424
|
-
logObj.args = [...args];
|
|
425
|
-
}
|
|
426
|
-
if (logObj.message) {
|
|
427
|
-
logObj.args.unshift(logObj.message);
|
|
428
|
-
delete logObj.message;
|
|
429
|
-
}
|
|
430
|
-
if (logObj.additional) {
|
|
431
|
-
if (!Array.isArray(logObj.additional)) {
|
|
432
|
-
logObj.additional = logObj.additional.split("\n");
|
|
433
|
-
}
|
|
434
|
-
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
435
|
-
delete logObj.additional;
|
|
436
|
-
}
|
|
437
|
-
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
438
|
-
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
439
|
-
const resolveLog = (newLog = false) => {
|
|
440
|
-
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
441
|
-
if (this._lastLog.object && repeated > 0) {
|
|
442
|
-
const args2 = [...this._lastLog.object.args];
|
|
443
|
-
if (repeated > 1) {
|
|
444
|
-
args2.push(`(repeated ${repeated} times)`);
|
|
445
|
-
}
|
|
446
|
-
this._log({ ...this._lastLog.object, args: args2 });
|
|
447
|
-
this._lastLog.count = 1;
|
|
448
|
-
}
|
|
449
|
-
if (newLog) {
|
|
450
|
-
this._lastLog.object = logObj;
|
|
451
|
-
this._log(logObj);
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
clearTimeout(this._lastLog.timeout);
|
|
455
|
-
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
456
|
-
this._lastLog.time = logObj.date;
|
|
457
|
-
if (diffTime < this.options.throttle) {
|
|
458
|
-
try {
|
|
459
|
-
const serializedLog = JSON.stringify([
|
|
460
|
-
logObj.type,
|
|
461
|
-
logObj.tag,
|
|
462
|
-
logObj.args
|
|
463
|
-
]);
|
|
464
|
-
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
465
|
-
this._lastLog.serialized = serializedLog;
|
|
466
|
-
if (isSameLog) {
|
|
467
|
-
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
468
|
-
if (this._lastLog.count > this.options.throttleMin) {
|
|
469
|
-
this._lastLog.timeout = setTimeout(
|
|
470
|
-
resolveLog,
|
|
471
|
-
this.options.throttle
|
|
472
|
-
);
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
} catch {
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
resolveLog(true);
|
|
480
|
-
}
|
|
481
|
-
_log(logObj) {
|
|
482
|
-
for (const reporter of this.options.reporters) {
|
|
483
|
-
reporter.log(logObj, {
|
|
484
|
-
options: this.options
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
490
|
-
if (input === undefined) {
|
|
491
|
-
return defaultLevel;
|
|
492
|
-
}
|
|
493
|
-
if (typeof input === "number") {
|
|
494
|
-
return input;
|
|
495
|
-
}
|
|
496
|
-
if (types[input] && types[input].level !== undefined) {
|
|
497
|
-
return types[input].level;
|
|
498
|
-
}
|
|
499
|
-
return defaultLevel;
|
|
500
|
-
}
|
|
501
|
-
Consola.prototype.add = Consola.prototype.addReporter;
|
|
502
|
-
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
503
|
-
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
504
|
-
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
505
|
-
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
506
|
-
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
507
|
-
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
508
|
-
function createConsola$1(options = {}) {
|
|
509
|
-
return new Consola(options);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
function parseStack$1(stack) {
|
|
513
|
-
const cwd = process.cwd() + sep;
|
|
514
|
-
const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
515
|
-
return lines;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
function writeStream(data, stream) {
|
|
519
|
-
const write = stream.__write || stream.write;
|
|
520
|
-
return write.call(stream, data);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
const bracket = (x) => x ? `[${x}]` : "";
|
|
524
|
-
class BasicReporter {
|
|
525
|
-
formatStack(stack, opts) {
|
|
526
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
527
|
-
return indent + parseStack$1(stack).join(`
|
|
528
|
-
${indent}`);
|
|
529
|
-
}
|
|
530
|
-
formatError(err, opts) {
|
|
531
|
-
const message = err.message ?? formatWithOptions(opts, err);
|
|
532
|
-
const stack = err.stack ? this.formatStack(err.stack, opts) : "";
|
|
533
|
-
const level = opts?.errorLevel || 0;
|
|
534
|
-
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
535
|
-
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
|
|
536
|
-
return causedPrefix + message + "\n" + stack + causedError;
|
|
537
|
-
}
|
|
538
|
-
formatArgs(args, opts) {
|
|
539
|
-
const _args = args.map((arg) => {
|
|
540
|
-
if (arg && typeof arg.stack === "string") {
|
|
541
|
-
return this.formatError(arg, opts);
|
|
542
|
-
}
|
|
543
|
-
return arg;
|
|
544
|
-
});
|
|
545
|
-
return formatWithOptions(opts, ..._args);
|
|
546
|
-
}
|
|
547
|
-
formatDate(date, opts) {
|
|
548
|
-
return opts.date ? date.toLocaleTimeString() : "";
|
|
549
|
-
}
|
|
550
|
-
filterAndJoin(arr) {
|
|
551
|
-
return arr.filter(Boolean).join(" ");
|
|
552
|
-
}
|
|
553
|
-
formatLogObj(logObj, opts) {
|
|
554
|
-
const message = this.formatArgs(logObj.args, opts);
|
|
555
|
-
if (logObj.type === "box") {
|
|
556
|
-
return "\n" + [
|
|
557
|
-
bracket(logObj.tag),
|
|
558
|
-
logObj.title && logObj.title,
|
|
559
|
-
...message.split("\n")
|
|
560
|
-
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
|
|
561
|
-
}
|
|
562
|
-
return this.filterAndJoin([
|
|
563
|
-
bracket(logObj.type),
|
|
564
|
-
bracket(logObj.tag),
|
|
565
|
-
message
|
|
566
|
-
]);
|
|
567
|
-
}
|
|
568
|
-
log(logObj, ctx) {
|
|
569
|
-
const line = this.formatLogObj(logObj, {
|
|
570
|
-
columns: ctx.options.stdout.columns || 0,
|
|
571
|
-
...ctx.options.formatOptions
|
|
572
|
-
});
|
|
573
|
-
return writeStream(
|
|
574
|
-
line + "\n",
|
|
575
|
-
logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
const {
|
|
581
|
-
env = {},
|
|
582
|
-
argv = [],
|
|
583
|
-
platform = ""
|
|
584
|
-
} = typeof process === "undefined" ? {} : process;
|
|
585
|
-
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
586
|
-
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
587
|
-
const isWindows = platform === "win32";
|
|
588
|
-
const isDumbTerminal = env.TERM === "dumb";
|
|
589
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
590
|
-
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
591
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
592
|
-
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
593
|
-
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
594
|
-
}
|
|
595
|
-
function clearBleed(index, string, open, close, replace) {
|
|
596
|
-
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
597
|
-
}
|
|
598
|
-
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
599
|
-
return (string) => string || !(string === "" || string === undefined) ? clearBleed(
|
|
600
|
-
("" + string).indexOf(close, at),
|
|
601
|
-
string,
|
|
602
|
-
open,
|
|
603
|
-
close,
|
|
604
|
-
replace
|
|
605
|
-
) : "";
|
|
606
|
-
}
|
|
607
|
-
function init(open, close, replace) {
|
|
608
|
-
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
609
|
-
}
|
|
610
|
-
const colorDefs = {
|
|
611
|
-
reset: init(0, 0),
|
|
612
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
613
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
614
|
-
italic: init(3, 23),
|
|
615
|
-
underline: init(4, 24),
|
|
616
|
-
inverse: init(7, 27),
|
|
617
|
-
hidden: init(8, 28),
|
|
618
|
-
strikethrough: init(9, 29),
|
|
619
|
-
black: init(30, 39),
|
|
620
|
-
red: init(31, 39),
|
|
621
|
-
green: init(32, 39),
|
|
622
|
-
yellow: init(33, 39),
|
|
623
|
-
blue: init(34, 39),
|
|
624
|
-
magenta: init(35, 39),
|
|
625
|
-
cyan: init(36, 39),
|
|
626
|
-
white: init(37, 39),
|
|
627
|
-
gray: init(90, 39),
|
|
628
|
-
bgBlack: init(40, 49),
|
|
629
|
-
bgRed: init(41, 49),
|
|
630
|
-
bgGreen: init(42, 49),
|
|
631
|
-
bgYellow: init(43, 49),
|
|
632
|
-
bgBlue: init(44, 49),
|
|
633
|
-
bgMagenta: init(45, 49),
|
|
634
|
-
bgCyan: init(46, 49),
|
|
635
|
-
bgWhite: init(47, 49),
|
|
636
|
-
blackBright: init(90, 39),
|
|
637
|
-
redBright: init(91, 39),
|
|
638
|
-
greenBright: init(92, 39),
|
|
639
|
-
yellowBright: init(93, 39),
|
|
640
|
-
blueBright: init(94, 39),
|
|
641
|
-
magentaBright: init(95, 39),
|
|
642
|
-
cyanBright: init(96, 39),
|
|
643
|
-
whiteBright: init(97, 39),
|
|
644
|
-
bgBlackBright: init(100, 49),
|
|
645
|
-
bgRedBright: init(101, 49),
|
|
646
|
-
bgGreenBright: init(102, 49),
|
|
647
|
-
bgYellowBright: init(103, 49),
|
|
648
|
-
bgBlueBright: init(104, 49),
|
|
649
|
-
bgMagentaBright: init(105, 49),
|
|
650
|
-
bgCyanBright: init(106, 49),
|
|
651
|
-
bgWhiteBright: init(107, 49)
|
|
652
|
-
};
|
|
653
|
-
function createColors(useColor = isColorSupported) {
|
|
654
|
-
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
655
|
-
}
|
|
656
|
-
const colors = createColors();
|
|
657
|
-
function getColor$1(color, fallback = "reset") {
|
|
658
|
-
return colors[color] || colors[fallback];
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
const ansiRegex$1 = [
|
|
662
|
-
String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
|
|
663
|
-
String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
|
|
664
|
-
].join("|");
|
|
665
|
-
function stripAnsi$1(text) {
|
|
666
|
-
return text.replace(new RegExp(ansiRegex$1, "g"), "");
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
const boxStylePresets = {
|
|
670
|
-
solid: {
|
|
671
|
-
tl: "\u250C",
|
|
672
|
-
tr: "\u2510",
|
|
673
|
-
bl: "\u2514",
|
|
674
|
-
br: "\u2518",
|
|
675
|
-
h: "\u2500",
|
|
676
|
-
v: "\u2502"
|
|
677
|
-
},
|
|
678
|
-
double: {
|
|
679
|
-
tl: "\u2554",
|
|
680
|
-
tr: "\u2557",
|
|
681
|
-
bl: "\u255A",
|
|
682
|
-
br: "\u255D",
|
|
683
|
-
h: "\u2550",
|
|
684
|
-
v: "\u2551"
|
|
685
|
-
},
|
|
686
|
-
doubleSingle: {
|
|
687
|
-
tl: "\u2553",
|
|
688
|
-
tr: "\u2556",
|
|
689
|
-
bl: "\u2559",
|
|
690
|
-
br: "\u255C",
|
|
691
|
-
h: "\u2500",
|
|
692
|
-
v: "\u2551"
|
|
693
|
-
},
|
|
694
|
-
doubleSingleRounded: {
|
|
695
|
-
tl: "\u256D",
|
|
696
|
-
tr: "\u256E",
|
|
697
|
-
bl: "\u2570",
|
|
698
|
-
br: "\u256F",
|
|
699
|
-
h: "\u2500",
|
|
700
|
-
v: "\u2551"
|
|
701
|
-
},
|
|
702
|
-
singleThick: {
|
|
703
|
-
tl: "\u250F",
|
|
704
|
-
tr: "\u2513",
|
|
705
|
-
bl: "\u2517",
|
|
706
|
-
br: "\u251B",
|
|
707
|
-
h: "\u2501",
|
|
708
|
-
v: "\u2503"
|
|
709
|
-
},
|
|
710
|
-
singleDouble: {
|
|
711
|
-
tl: "\u2552",
|
|
712
|
-
tr: "\u2555",
|
|
713
|
-
bl: "\u2558",
|
|
714
|
-
br: "\u255B",
|
|
715
|
-
h: "\u2550",
|
|
716
|
-
v: "\u2502"
|
|
717
|
-
},
|
|
718
|
-
singleDoubleRounded: {
|
|
719
|
-
tl: "\u256D",
|
|
720
|
-
tr: "\u256E",
|
|
721
|
-
bl: "\u2570",
|
|
722
|
-
br: "\u256F",
|
|
723
|
-
h: "\u2550",
|
|
724
|
-
v: "\u2502"
|
|
725
|
-
},
|
|
726
|
-
rounded: {
|
|
727
|
-
tl: "\u256D",
|
|
728
|
-
tr: "\u256E",
|
|
729
|
-
bl: "\u2570",
|
|
730
|
-
br: "\u256F",
|
|
731
|
-
h: "\u2500",
|
|
732
|
-
v: "\u2502"
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
|
-
const defaultStyle = {
|
|
736
|
-
borderColor: "white",
|
|
737
|
-
borderStyle: "rounded",
|
|
738
|
-
valign: "center",
|
|
739
|
-
padding: 2,
|
|
740
|
-
marginLeft: 1,
|
|
741
|
-
marginTop: 1,
|
|
742
|
-
marginBottom: 1
|
|
743
|
-
};
|
|
744
|
-
function box(text, _opts = {}) {
|
|
745
|
-
const opts = {
|
|
746
|
-
..._opts,
|
|
747
|
-
style: {
|
|
748
|
-
...defaultStyle,
|
|
749
|
-
..._opts.style
|
|
750
|
-
}
|
|
751
|
-
};
|
|
752
|
-
const textLines = text.split("\n");
|
|
753
|
-
const boxLines = [];
|
|
754
|
-
const _color = getColor$1(opts.style.borderColor);
|
|
755
|
-
const borderStyle = {
|
|
756
|
-
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
757
|
-
};
|
|
758
|
-
if (_color) {
|
|
759
|
-
for (const key in borderStyle) {
|
|
760
|
-
borderStyle[key] = _color(
|
|
761
|
-
borderStyle[key]
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
766
|
-
const height = textLines.length + paddingOffset;
|
|
767
|
-
const width = Math.max(...textLines.map((line) => stripAnsi$1(line).length)) + paddingOffset;
|
|
768
|
-
const widthOffset = width + paddingOffset;
|
|
769
|
-
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
770
|
-
if (opts.style.marginTop > 0) {
|
|
771
|
-
boxLines.push("".repeat(opts.style.marginTop));
|
|
772
|
-
}
|
|
773
|
-
if (opts.title) {
|
|
774
|
-
const title = _color ? _color(opts.title) : opts.title;
|
|
775
|
-
const left = borderStyle.h.repeat(
|
|
776
|
-
Math.floor((width - stripAnsi$1(opts.title).length) / 2)
|
|
777
|
-
);
|
|
778
|
-
const right = borderStyle.h.repeat(
|
|
779
|
-
width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset
|
|
780
|
-
);
|
|
781
|
-
boxLines.push(
|
|
782
|
-
`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
|
|
783
|
-
);
|
|
784
|
-
} else {
|
|
785
|
-
boxLines.push(
|
|
786
|
-
`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
|
|
787
|
-
);
|
|
788
|
-
}
|
|
789
|
-
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
790
|
-
for (let i = 0; i < height; i++) {
|
|
791
|
-
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
792
|
-
boxLines.push(
|
|
793
|
-
`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
|
|
794
|
-
);
|
|
795
|
-
} else {
|
|
796
|
-
const line = textLines[i - valignOffset];
|
|
797
|
-
const left = " ".repeat(paddingOffset);
|
|
798
|
-
const right = " ".repeat(width - stripAnsi$1(line).length);
|
|
799
|
-
boxLines.push(
|
|
800
|
-
`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
|
|
801
|
-
);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
boxLines.push(
|
|
805
|
-
`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
|
|
806
|
-
);
|
|
807
|
-
if (opts.style.marginBottom > 0) {
|
|
808
|
-
boxLines.push("".repeat(opts.style.marginBottom));
|
|
809
|
-
}
|
|
810
|
-
return boxLines.join("\n");
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
const r=Object.create(null),i=e=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?r:globalThis),s$1=new Proxy(r,{get(e,o){return i()[o]??r[o]},has(e,o){const E=i();return o in E||o in r},set(e,o,E){const b=i(true);return b[o]=E,true},deleteProperty(e,o){if(!o)return false;const E=i(true);return delete E[o],true},ownKeys(){const e=i(true);return Object.keys(e)}}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",B=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:true}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:true}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:false}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:false}],["VERCEL","VERCEL_ENV",{ci:false}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:false}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:true}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:true}]];function p(){if(globalThis.process?.env)for(const e of B){const o=e[1]||e[0];if(globalThis.process?.env[o])return {name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:false}:{name:"",ci:false}}const l=p();l.name;function n(e){return e?e!=="false":false}const I=globalThis.process?.platform||"",T=n(s$1.CI)||l.ci!==false,R=n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),U=n(s$1.DEBUG),A=t==="test"||n(s$1.TEST);n(s$1.MINIMAL)||T||A||!R;const _=/^win/i.test(I);!n(s$1.NO_COLOR)&&(n(s$1.FORCE_COLOR)||(R||_)&&s$1.TERM!=="dumb"||T);const C=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(C?.split(".")[0])||null;const y=globalThis.process||Object.create(null),c={versions:{}};new Proxy(y,{get(e,o){if(o==="env")return s$1;if(o in e)return e[o];if(o in c)return c[o]}});const L=globalThis.process?.release?.name==="node",a=!!globalThis.Bun||!!globalThis.process?.versions?.bun,D=!!globalThis.Deno,O=!!globalThis.fastly,S=!!globalThis.Netlify,N=!!globalThis.EdgeRuntime,P=globalThis.navigator?.userAgent==="Cloudflare-Workers",F=[[S,"netlify"],[N,"edge-light"],[P,"workerd"],[O,"fastly"],[D,"deno"],[a,"bun"],[L,"node"]];function G(){const e=F.find(o=>o[0]);if(e)return {name:e[1]}}const u=G();u?.name||"";
|
|
814
|
-
|
|
815
|
-
function ansiRegex({onlyFirst = false} = {}) {
|
|
816
|
-
// Valid string terminator sequences are BEL, ESC\, and 0x9c
|
|
817
|
-
const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
|
|
818
|
-
const pattern = [
|
|
819
|
-
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
|
|
820
|
-
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
|
|
821
|
-
].join('|');
|
|
822
|
-
|
|
823
|
-
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
const regex = ansiRegex();
|
|
827
|
-
|
|
828
|
-
function stripAnsi(string) {
|
|
829
|
-
if (typeof string !== 'string') {
|
|
830
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
// Even though the regex is global, we don't need to reset the `.lastIndex`
|
|
834
|
-
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
|
|
835
|
-
// and doing it manually has a performance penalty.
|
|
836
|
-
return string.replace(regex, '');
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
// Generated code.
|
|
840
|
-
|
|
841
|
-
function isAmbiguous(x) {
|
|
842
|
-
return x === 0xA1
|
|
843
|
-
|| x === 0xA4
|
|
844
|
-
|| x === 0xA7
|
|
845
|
-
|| x === 0xA8
|
|
846
|
-
|| x === 0xAA
|
|
847
|
-
|| x === 0xAD
|
|
848
|
-
|| x === 0xAE
|
|
849
|
-
|| x >= 0xB0 && x <= 0xB4
|
|
850
|
-
|| x >= 0xB6 && x <= 0xBA
|
|
851
|
-
|| x >= 0xBC && x <= 0xBF
|
|
852
|
-
|| x === 0xC6
|
|
853
|
-
|| x === 0xD0
|
|
854
|
-
|| x === 0xD7
|
|
855
|
-
|| x === 0xD8
|
|
856
|
-
|| x >= 0xDE && x <= 0xE1
|
|
857
|
-
|| x === 0xE6
|
|
858
|
-
|| x >= 0xE8 && x <= 0xEA
|
|
859
|
-
|| x === 0xEC
|
|
860
|
-
|| x === 0xED
|
|
861
|
-
|| x === 0xF0
|
|
862
|
-
|| x === 0xF2
|
|
863
|
-
|| x === 0xF3
|
|
864
|
-
|| x >= 0xF7 && x <= 0xFA
|
|
865
|
-
|| x === 0xFC
|
|
866
|
-
|| x === 0xFE
|
|
867
|
-
|| x === 0x101
|
|
868
|
-
|| x === 0x111
|
|
869
|
-
|| x === 0x113
|
|
870
|
-
|| x === 0x11B
|
|
871
|
-
|| x === 0x126
|
|
872
|
-
|| x === 0x127
|
|
873
|
-
|| x === 0x12B
|
|
874
|
-
|| x >= 0x131 && x <= 0x133
|
|
875
|
-
|| x === 0x138
|
|
876
|
-
|| x >= 0x13F && x <= 0x142
|
|
877
|
-
|| x === 0x144
|
|
878
|
-
|| x >= 0x148 && x <= 0x14B
|
|
879
|
-
|| x === 0x14D
|
|
880
|
-
|| x === 0x152
|
|
881
|
-
|| x === 0x153
|
|
882
|
-
|| x === 0x166
|
|
883
|
-
|| x === 0x167
|
|
884
|
-
|| x === 0x16B
|
|
885
|
-
|| x === 0x1CE
|
|
886
|
-
|| x === 0x1D0
|
|
887
|
-
|| x === 0x1D2
|
|
888
|
-
|| x === 0x1D4
|
|
889
|
-
|| x === 0x1D6
|
|
890
|
-
|| x === 0x1D8
|
|
891
|
-
|| x === 0x1DA
|
|
892
|
-
|| x === 0x1DC
|
|
893
|
-
|| x === 0x251
|
|
894
|
-
|| x === 0x261
|
|
895
|
-
|| x === 0x2C4
|
|
896
|
-
|| x === 0x2C7
|
|
897
|
-
|| x >= 0x2C9 && x <= 0x2CB
|
|
898
|
-
|| x === 0x2CD
|
|
899
|
-
|| x === 0x2D0
|
|
900
|
-
|| x >= 0x2D8 && x <= 0x2DB
|
|
901
|
-
|| x === 0x2DD
|
|
902
|
-
|| x === 0x2DF
|
|
903
|
-
|| x >= 0x300 && x <= 0x36F
|
|
904
|
-
|| x >= 0x391 && x <= 0x3A1
|
|
905
|
-
|| x >= 0x3A3 && x <= 0x3A9
|
|
906
|
-
|| x >= 0x3B1 && x <= 0x3C1
|
|
907
|
-
|| x >= 0x3C3 && x <= 0x3C9
|
|
908
|
-
|| x === 0x401
|
|
909
|
-
|| x >= 0x410 && x <= 0x44F
|
|
910
|
-
|| x === 0x451
|
|
911
|
-
|| x === 0x2010
|
|
912
|
-
|| x >= 0x2013 && x <= 0x2016
|
|
913
|
-
|| x === 0x2018
|
|
914
|
-
|| x === 0x2019
|
|
915
|
-
|| x === 0x201C
|
|
916
|
-
|| x === 0x201D
|
|
917
|
-
|| x >= 0x2020 && x <= 0x2022
|
|
918
|
-
|| x >= 0x2024 && x <= 0x2027
|
|
919
|
-
|| x === 0x2030
|
|
920
|
-
|| x === 0x2032
|
|
921
|
-
|| x === 0x2033
|
|
922
|
-
|| x === 0x2035
|
|
923
|
-
|| x === 0x203B
|
|
924
|
-
|| x === 0x203E
|
|
925
|
-
|| x === 0x2074
|
|
926
|
-
|| x === 0x207F
|
|
927
|
-
|| x >= 0x2081 && x <= 0x2084
|
|
928
|
-
|| x === 0x20AC
|
|
929
|
-
|| x === 0x2103
|
|
930
|
-
|| x === 0x2105
|
|
931
|
-
|| x === 0x2109
|
|
932
|
-
|| x === 0x2113
|
|
933
|
-
|| x === 0x2116
|
|
934
|
-
|| x === 0x2121
|
|
935
|
-
|| x === 0x2122
|
|
936
|
-
|| x === 0x2126
|
|
937
|
-
|| x === 0x212B
|
|
938
|
-
|| x === 0x2153
|
|
939
|
-
|| x === 0x2154
|
|
940
|
-
|| x >= 0x215B && x <= 0x215E
|
|
941
|
-
|| x >= 0x2160 && x <= 0x216B
|
|
942
|
-
|| x >= 0x2170 && x <= 0x2179
|
|
943
|
-
|| x === 0x2189
|
|
944
|
-
|| x >= 0x2190 && x <= 0x2199
|
|
945
|
-
|| x === 0x21B8
|
|
946
|
-
|| x === 0x21B9
|
|
947
|
-
|| x === 0x21D2
|
|
948
|
-
|| x === 0x21D4
|
|
949
|
-
|| x === 0x21E7
|
|
950
|
-
|| x === 0x2200
|
|
951
|
-
|| x === 0x2202
|
|
952
|
-
|| x === 0x2203
|
|
953
|
-
|| x === 0x2207
|
|
954
|
-
|| x === 0x2208
|
|
955
|
-
|| x === 0x220B
|
|
956
|
-
|| x === 0x220F
|
|
957
|
-
|| x === 0x2211
|
|
958
|
-
|| x === 0x2215
|
|
959
|
-
|| x === 0x221A
|
|
960
|
-
|| x >= 0x221D && x <= 0x2220
|
|
961
|
-
|| x === 0x2223
|
|
962
|
-
|| x === 0x2225
|
|
963
|
-
|| x >= 0x2227 && x <= 0x222C
|
|
964
|
-
|| x === 0x222E
|
|
965
|
-
|| x >= 0x2234 && x <= 0x2237
|
|
966
|
-
|| x === 0x223C
|
|
967
|
-
|| x === 0x223D
|
|
968
|
-
|| x === 0x2248
|
|
969
|
-
|| x === 0x224C
|
|
970
|
-
|| x === 0x2252
|
|
971
|
-
|| x === 0x2260
|
|
972
|
-
|| x === 0x2261
|
|
973
|
-
|| x >= 0x2264 && x <= 0x2267
|
|
974
|
-
|| x === 0x226A
|
|
975
|
-
|| x === 0x226B
|
|
976
|
-
|| x === 0x226E
|
|
977
|
-
|| x === 0x226F
|
|
978
|
-
|| x === 0x2282
|
|
979
|
-
|| x === 0x2283
|
|
980
|
-
|| x === 0x2286
|
|
981
|
-
|| x === 0x2287
|
|
982
|
-
|| x === 0x2295
|
|
983
|
-
|| x === 0x2299
|
|
984
|
-
|| x === 0x22A5
|
|
985
|
-
|| x === 0x22BF
|
|
986
|
-
|| x === 0x2312
|
|
987
|
-
|| x >= 0x2460 && x <= 0x24E9
|
|
988
|
-
|| x >= 0x24EB && x <= 0x254B
|
|
989
|
-
|| x >= 0x2550 && x <= 0x2573
|
|
990
|
-
|| x >= 0x2580 && x <= 0x258F
|
|
991
|
-
|| x >= 0x2592 && x <= 0x2595
|
|
992
|
-
|| x === 0x25A0
|
|
993
|
-
|| x === 0x25A1
|
|
994
|
-
|| x >= 0x25A3 && x <= 0x25A9
|
|
995
|
-
|| x === 0x25B2
|
|
996
|
-
|| x === 0x25B3
|
|
997
|
-
|| x === 0x25B6
|
|
998
|
-
|| x === 0x25B7
|
|
999
|
-
|| x === 0x25BC
|
|
1000
|
-
|| x === 0x25BD
|
|
1001
|
-
|| x === 0x25C0
|
|
1002
|
-
|| x === 0x25C1
|
|
1003
|
-
|| x >= 0x25C6 && x <= 0x25C8
|
|
1004
|
-
|| x === 0x25CB
|
|
1005
|
-
|| x >= 0x25CE && x <= 0x25D1
|
|
1006
|
-
|| x >= 0x25E2 && x <= 0x25E5
|
|
1007
|
-
|| x === 0x25EF
|
|
1008
|
-
|| x === 0x2605
|
|
1009
|
-
|| x === 0x2606
|
|
1010
|
-
|| x === 0x2609
|
|
1011
|
-
|| x === 0x260E
|
|
1012
|
-
|| x === 0x260F
|
|
1013
|
-
|| x === 0x261C
|
|
1014
|
-
|| x === 0x261E
|
|
1015
|
-
|| x === 0x2640
|
|
1016
|
-
|| x === 0x2642
|
|
1017
|
-
|| x === 0x2660
|
|
1018
|
-
|| x === 0x2661
|
|
1019
|
-
|| x >= 0x2663 && x <= 0x2665
|
|
1020
|
-
|| x >= 0x2667 && x <= 0x266A
|
|
1021
|
-
|| x === 0x266C
|
|
1022
|
-
|| x === 0x266D
|
|
1023
|
-
|| x === 0x266F
|
|
1024
|
-
|| x === 0x269E
|
|
1025
|
-
|| x === 0x269F
|
|
1026
|
-
|| x === 0x26BF
|
|
1027
|
-
|| x >= 0x26C6 && x <= 0x26CD
|
|
1028
|
-
|| x >= 0x26CF && x <= 0x26D3
|
|
1029
|
-
|| x >= 0x26D5 && x <= 0x26E1
|
|
1030
|
-
|| x === 0x26E3
|
|
1031
|
-
|| x === 0x26E8
|
|
1032
|
-
|| x === 0x26E9
|
|
1033
|
-
|| x >= 0x26EB && x <= 0x26F1
|
|
1034
|
-
|| x === 0x26F4
|
|
1035
|
-
|| x >= 0x26F6 && x <= 0x26F9
|
|
1036
|
-
|| x === 0x26FB
|
|
1037
|
-
|| x === 0x26FC
|
|
1038
|
-
|| x === 0x26FE
|
|
1039
|
-
|| x === 0x26FF
|
|
1040
|
-
|| x === 0x273D
|
|
1041
|
-
|| x >= 0x2776 && x <= 0x277F
|
|
1042
|
-
|| x >= 0x2B56 && x <= 0x2B59
|
|
1043
|
-
|| x >= 0x3248 && x <= 0x324F
|
|
1044
|
-
|| x >= 0xE000 && x <= 0xF8FF
|
|
1045
|
-
|| x >= 0xFE00 && x <= 0xFE0F
|
|
1046
|
-
|| x === 0xFFFD
|
|
1047
|
-
|| x >= 0x1F100 && x <= 0x1F10A
|
|
1048
|
-
|| x >= 0x1F110 && x <= 0x1F12D
|
|
1049
|
-
|| x >= 0x1F130 && x <= 0x1F169
|
|
1050
|
-
|| x >= 0x1F170 && x <= 0x1F18D
|
|
1051
|
-
|| x === 0x1F18F
|
|
1052
|
-
|| x === 0x1F190
|
|
1053
|
-
|| x >= 0x1F19B && x <= 0x1F1AC
|
|
1054
|
-
|| x >= 0xE0100 && x <= 0xE01EF
|
|
1055
|
-
|| x >= 0xF0000 && x <= 0xFFFFD
|
|
1056
|
-
|| x >= 0x100000 && x <= 0x10FFFD;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
function isFullWidth(x) {
|
|
1060
|
-
return x === 0x3000
|
|
1061
|
-
|| x >= 0xFF01 && x <= 0xFF60
|
|
1062
|
-
|| x >= 0xFFE0 && x <= 0xFFE6;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
function isWide(x) {
|
|
1066
|
-
return x >= 0x1100 && x <= 0x115F
|
|
1067
|
-
|| x === 0x231A
|
|
1068
|
-
|| x === 0x231B
|
|
1069
|
-
|| x === 0x2329
|
|
1070
|
-
|| x === 0x232A
|
|
1071
|
-
|| x >= 0x23E9 && x <= 0x23EC
|
|
1072
|
-
|| x === 0x23F0
|
|
1073
|
-
|| x === 0x23F3
|
|
1074
|
-
|| x === 0x25FD
|
|
1075
|
-
|| x === 0x25FE
|
|
1076
|
-
|| x === 0x2614
|
|
1077
|
-
|| x === 0x2615
|
|
1078
|
-
|| x >= 0x2630 && x <= 0x2637
|
|
1079
|
-
|| x >= 0x2648 && x <= 0x2653
|
|
1080
|
-
|| x === 0x267F
|
|
1081
|
-
|| x >= 0x268A && x <= 0x268F
|
|
1082
|
-
|| x === 0x2693
|
|
1083
|
-
|| x === 0x26A1
|
|
1084
|
-
|| x === 0x26AA
|
|
1085
|
-
|| x === 0x26AB
|
|
1086
|
-
|| x === 0x26BD
|
|
1087
|
-
|| x === 0x26BE
|
|
1088
|
-
|| x === 0x26C4
|
|
1089
|
-
|| x === 0x26C5
|
|
1090
|
-
|| x === 0x26CE
|
|
1091
|
-
|| x === 0x26D4
|
|
1092
|
-
|| x === 0x26EA
|
|
1093
|
-
|| x === 0x26F2
|
|
1094
|
-
|| x === 0x26F3
|
|
1095
|
-
|| x === 0x26F5
|
|
1096
|
-
|| x === 0x26FA
|
|
1097
|
-
|| x === 0x26FD
|
|
1098
|
-
|| x === 0x2705
|
|
1099
|
-
|| x === 0x270A
|
|
1100
|
-
|| x === 0x270B
|
|
1101
|
-
|| x === 0x2728
|
|
1102
|
-
|| x === 0x274C
|
|
1103
|
-
|| x === 0x274E
|
|
1104
|
-
|| x >= 0x2753 && x <= 0x2755
|
|
1105
|
-
|| x === 0x2757
|
|
1106
|
-
|| x >= 0x2795 && x <= 0x2797
|
|
1107
|
-
|| x === 0x27B0
|
|
1108
|
-
|| x === 0x27BF
|
|
1109
|
-
|| x === 0x2B1B
|
|
1110
|
-
|| x === 0x2B1C
|
|
1111
|
-
|| x === 0x2B50
|
|
1112
|
-
|| x === 0x2B55
|
|
1113
|
-
|| x >= 0x2E80 && x <= 0x2E99
|
|
1114
|
-
|| x >= 0x2E9B && x <= 0x2EF3
|
|
1115
|
-
|| x >= 0x2F00 && x <= 0x2FD5
|
|
1116
|
-
|| x >= 0x2FF0 && x <= 0x2FFF
|
|
1117
|
-
|| x >= 0x3001 && x <= 0x303E
|
|
1118
|
-
|| x >= 0x3041 && x <= 0x3096
|
|
1119
|
-
|| x >= 0x3099 && x <= 0x30FF
|
|
1120
|
-
|| x >= 0x3105 && x <= 0x312F
|
|
1121
|
-
|| x >= 0x3131 && x <= 0x318E
|
|
1122
|
-
|| x >= 0x3190 && x <= 0x31E5
|
|
1123
|
-
|| x >= 0x31EF && x <= 0x321E
|
|
1124
|
-
|| x >= 0x3220 && x <= 0x3247
|
|
1125
|
-
|| x >= 0x3250 && x <= 0xA48C
|
|
1126
|
-
|| x >= 0xA490 && x <= 0xA4C6
|
|
1127
|
-
|| x >= 0xA960 && x <= 0xA97C
|
|
1128
|
-
|| x >= 0xAC00 && x <= 0xD7A3
|
|
1129
|
-
|| x >= 0xF900 && x <= 0xFAFF
|
|
1130
|
-
|| x >= 0xFE10 && x <= 0xFE19
|
|
1131
|
-
|| x >= 0xFE30 && x <= 0xFE52
|
|
1132
|
-
|| x >= 0xFE54 && x <= 0xFE66
|
|
1133
|
-
|| x >= 0xFE68 && x <= 0xFE6B
|
|
1134
|
-
|| x >= 0x16FE0 && x <= 0x16FE4
|
|
1135
|
-
|| x === 0x16FF0
|
|
1136
|
-
|| x === 0x16FF1
|
|
1137
|
-
|| x >= 0x17000 && x <= 0x187F7
|
|
1138
|
-
|| x >= 0x18800 && x <= 0x18CD5
|
|
1139
|
-
|| x >= 0x18CFF && x <= 0x18D08
|
|
1140
|
-
|| x >= 0x1AFF0 && x <= 0x1AFF3
|
|
1141
|
-
|| x >= 0x1AFF5 && x <= 0x1AFFB
|
|
1142
|
-
|| x === 0x1AFFD
|
|
1143
|
-
|| x === 0x1AFFE
|
|
1144
|
-
|| x >= 0x1B000 && x <= 0x1B122
|
|
1145
|
-
|| x === 0x1B132
|
|
1146
|
-
|| x >= 0x1B150 && x <= 0x1B152
|
|
1147
|
-
|| x === 0x1B155
|
|
1148
|
-
|| x >= 0x1B164 && x <= 0x1B167
|
|
1149
|
-
|| x >= 0x1B170 && x <= 0x1B2FB
|
|
1150
|
-
|| x >= 0x1D300 && x <= 0x1D356
|
|
1151
|
-
|| x >= 0x1D360 && x <= 0x1D376
|
|
1152
|
-
|| x === 0x1F004
|
|
1153
|
-
|| x === 0x1F0CF
|
|
1154
|
-
|| x === 0x1F18E
|
|
1155
|
-
|| x >= 0x1F191 && x <= 0x1F19A
|
|
1156
|
-
|| x >= 0x1F200 && x <= 0x1F202
|
|
1157
|
-
|| x >= 0x1F210 && x <= 0x1F23B
|
|
1158
|
-
|| x >= 0x1F240 && x <= 0x1F248
|
|
1159
|
-
|| x === 0x1F250
|
|
1160
|
-
|| x === 0x1F251
|
|
1161
|
-
|| x >= 0x1F260 && x <= 0x1F265
|
|
1162
|
-
|| x >= 0x1F300 && x <= 0x1F320
|
|
1163
|
-
|| x >= 0x1F32D && x <= 0x1F335
|
|
1164
|
-
|| x >= 0x1F337 && x <= 0x1F37C
|
|
1165
|
-
|| x >= 0x1F37E && x <= 0x1F393
|
|
1166
|
-
|| x >= 0x1F3A0 && x <= 0x1F3CA
|
|
1167
|
-
|| x >= 0x1F3CF && x <= 0x1F3D3
|
|
1168
|
-
|| x >= 0x1F3E0 && x <= 0x1F3F0
|
|
1169
|
-
|| x === 0x1F3F4
|
|
1170
|
-
|| x >= 0x1F3F8 && x <= 0x1F43E
|
|
1171
|
-
|| x === 0x1F440
|
|
1172
|
-
|| x >= 0x1F442 && x <= 0x1F4FC
|
|
1173
|
-
|| x >= 0x1F4FF && x <= 0x1F53D
|
|
1174
|
-
|| x >= 0x1F54B && x <= 0x1F54E
|
|
1175
|
-
|| x >= 0x1F550 && x <= 0x1F567
|
|
1176
|
-
|| x === 0x1F57A
|
|
1177
|
-
|| x === 0x1F595
|
|
1178
|
-
|| x === 0x1F596
|
|
1179
|
-
|| x === 0x1F5A4
|
|
1180
|
-
|| x >= 0x1F5FB && x <= 0x1F64F
|
|
1181
|
-
|| x >= 0x1F680 && x <= 0x1F6C5
|
|
1182
|
-
|| x === 0x1F6CC
|
|
1183
|
-
|| x >= 0x1F6D0 && x <= 0x1F6D2
|
|
1184
|
-
|| x >= 0x1F6D5 && x <= 0x1F6D7
|
|
1185
|
-
|| x >= 0x1F6DC && x <= 0x1F6DF
|
|
1186
|
-
|| x === 0x1F6EB
|
|
1187
|
-
|| x === 0x1F6EC
|
|
1188
|
-
|| x >= 0x1F6F4 && x <= 0x1F6FC
|
|
1189
|
-
|| x >= 0x1F7E0 && x <= 0x1F7EB
|
|
1190
|
-
|| x === 0x1F7F0
|
|
1191
|
-
|| x >= 0x1F90C && x <= 0x1F93A
|
|
1192
|
-
|| x >= 0x1F93C && x <= 0x1F945
|
|
1193
|
-
|| x >= 0x1F947 && x <= 0x1F9FF
|
|
1194
|
-
|| x >= 0x1FA70 && x <= 0x1FA7C
|
|
1195
|
-
|| x >= 0x1FA80 && x <= 0x1FA89
|
|
1196
|
-
|| x >= 0x1FA8F && x <= 0x1FAC6
|
|
1197
|
-
|| x >= 0x1FACE && x <= 0x1FADC
|
|
1198
|
-
|| x >= 0x1FADF && x <= 0x1FAE9
|
|
1199
|
-
|| x >= 0x1FAF0 && x <= 0x1FAF8
|
|
1200
|
-
|| x >= 0x20000 && x <= 0x2FFFD
|
|
1201
|
-
|| x >= 0x30000 && x <= 0x3FFFD;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
function validate(codePoint) {
|
|
1205
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
1206
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {
|
|
1211
|
-
validate(codePoint);
|
|
1212
|
-
|
|
1213
|
-
if (
|
|
1214
|
-
isFullWidth(codePoint)
|
|
1215
|
-
|| isWide(codePoint)
|
|
1216
|
-
|| (ambiguousAsWide && isAmbiguous(codePoint))
|
|
1217
|
-
) {
|
|
1218
|
-
return 2;
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
return 1;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
const emojiRegex = () => {
|
|
1225
|
-
// https://mths.be/emoji
|
|
1226
|
-
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
1227
|
-
};
|
|
1228
|
-
|
|
1229
|
-
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split('') };
|
|
1230
|
-
|
|
1231
|
-
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
1232
|
-
|
|
1233
|
-
function stringWidth$1(string, options = {}) {
|
|
1234
|
-
if (typeof string !== 'string' || string.length === 0) {
|
|
1235
|
-
return 0;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
const {
|
|
1239
|
-
ambiguousIsNarrow = true,
|
|
1240
|
-
countAnsiEscapeCodes = false,
|
|
1241
|
-
} = options;
|
|
1242
|
-
|
|
1243
|
-
if (!countAnsiEscapeCodes) {
|
|
1244
|
-
string = stripAnsi(string);
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
if (string.length === 0) {
|
|
1248
|
-
return 0;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
let width = 0;
|
|
1252
|
-
const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
|
|
1253
|
-
|
|
1254
|
-
for (const {segment: character} of segmenter.segment(string)) {
|
|
1255
|
-
const codePoint = character.codePointAt(0);
|
|
1256
|
-
|
|
1257
|
-
// Ignore control characters
|
|
1258
|
-
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
|
|
1259
|
-
continue;
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
// Ignore zero-width characters
|
|
1263
|
-
if (
|
|
1264
|
-
(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
|
|
1265
|
-
|| codePoint === 0xFE_FF // Zero-width no-break space
|
|
1266
|
-
) {
|
|
1267
|
-
continue;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
// Ignore combining characters
|
|
1271
|
-
if (
|
|
1272
|
-
(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
|
|
1273
|
-
|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
|
|
1274
|
-
|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
|
|
1275
|
-
|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
|
|
1276
|
-
|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
|
|
1277
|
-
) {
|
|
1278
|
-
continue;
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
// Ignore surrogate pairs
|
|
1282
|
-
if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
|
|
1283
|
-
continue;
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
// Ignore variation selectors
|
|
1287
|
-
if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
|
|
1288
|
-
continue;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
// This covers some of the above cases, but we still keep them for performance reasons.
|
|
1292
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
1293
|
-
continue;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
// TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
|
|
1297
|
-
if (emojiRegex().test(character)) {
|
|
1298
|
-
width += 2;
|
|
1299
|
-
continue;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
return width;
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
function isUnicodeSupported() {
|
|
1309
|
-
const {env} = p$1;
|
|
1310
|
-
const {TERM, TERM_PROGRAM} = env;
|
|
1311
|
-
|
|
1312
|
-
if (p$1.platform !== 'win32') {
|
|
1313
|
-
return TERM !== 'linux'; // Linux console (kernel)
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
return Boolean(env.WT_SESSION) // Windows Terminal
|
|
1317
|
-
|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|
|
1318
|
-
|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|
|
1319
|
-
|| TERM_PROGRAM === 'Terminus-Sublime'
|
|
1320
|
-
|| TERM_PROGRAM === 'vscode'
|
|
1321
|
-
|| TERM === 'xterm-256color'
|
|
1322
|
-
|| TERM === 'alacritty'
|
|
1323
|
-
|| TERM === 'rxvt-unicode'
|
|
1324
|
-
|| TERM === 'rxvt-unicode-256color'
|
|
1325
|
-
|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
const TYPE_COLOR_MAP = {
|
|
1329
|
-
info: "cyan",
|
|
1330
|
-
fail: "red",
|
|
1331
|
-
success: "green",
|
|
1332
|
-
ready: "green",
|
|
1333
|
-
start: "magenta"
|
|
1334
|
-
};
|
|
1335
|
-
const LEVEL_COLOR_MAP = {
|
|
1336
|
-
0: "red",
|
|
1337
|
-
1: "yellow"
|
|
1338
|
-
};
|
|
1339
|
-
const unicode = isUnicodeSupported();
|
|
1340
|
-
const s = (c, fallback) => unicode ? c : fallback;
|
|
1341
|
-
const TYPE_ICONS = {
|
|
1342
|
-
error: s("\u2716", "\xD7"),
|
|
1343
|
-
fatal: s("\u2716", "\xD7"),
|
|
1344
|
-
ready: s("\u2714", "\u221A"),
|
|
1345
|
-
warn: s("\u26A0", "\u203C"),
|
|
1346
|
-
info: s("\u2139", "i"),
|
|
1347
|
-
success: s("\u2714", "\u221A"),
|
|
1348
|
-
debug: s("\u2699", "D"),
|
|
1349
|
-
trace: s("\u2192", "\u2192"),
|
|
1350
|
-
fail: s("\u2716", "\xD7"),
|
|
1351
|
-
start: s("\u25D0", "o"),
|
|
1352
|
-
log: ""
|
|
1353
|
-
};
|
|
1354
|
-
function stringWidth(str) {
|
|
1355
|
-
const hasICU = typeof Intl === "object";
|
|
1356
|
-
if (!hasICU || !Intl.Segmenter) {
|
|
1357
|
-
return stripAnsi$1(str).length;
|
|
1358
|
-
}
|
|
1359
|
-
return stringWidth$1(str);
|
|
1360
|
-
}
|
|
1361
|
-
class FancyReporter extends BasicReporter {
|
|
1362
|
-
formatStack(stack, opts) {
|
|
1363
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
1364
|
-
return `
|
|
1365
|
-
${indent}` + parseStack$1(stack).map(
|
|
1366
|
-
(line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)
|
|
1367
|
-
).join(`
|
|
1368
|
-
${indent}`);
|
|
1369
|
-
}
|
|
1370
|
-
formatType(logObj, isBadge, opts) {
|
|
1371
|
-
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
|
|
1372
|
-
if (isBadge) {
|
|
1373
|
-
return getBgColor(typeColor)(
|
|
1374
|
-
colors.black(` ${logObj.type.toUpperCase()} `)
|
|
1375
|
-
);
|
|
1376
|
-
}
|
|
1377
|
-
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
|
|
1378
|
-
return _type ? getColor(typeColor)(_type) : "";
|
|
1379
|
-
}
|
|
1380
|
-
formatLogObj(logObj, opts) {
|
|
1381
|
-
const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
|
|
1382
|
-
"\n"
|
|
1383
|
-
);
|
|
1384
|
-
if (logObj.type === "box") {
|
|
1385
|
-
return box(
|
|
1386
|
-
characterFormat(
|
|
1387
|
-
message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
|
|
1388
|
-
),
|
|
1389
|
-
{
|
|
1390
|
-
title: logObj.title ? characterFormat(logObj.title) : undefined,
|
|
1391
|
-
style: logObj.style
|
|
1392
|
-
}
|
|
1393
|
-
);
|
|
1394
|
-
}
|
|
1395
|
-
const date = this.formatDate(logObj.date, opts);
|
|
1396
|
-
const coloredDate = date && colors.gray(date);
|
|
1397
|
-
const isBadge = logObj.badge ?? logObj.level < 2;
|
|
1398
|
-
const type = this.formatType(logObj, isBadge, opts);
|
|
1399
|
-
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
|
|
1400
|
-
let line;
|
|
1401
|
-
const left = this.filterAndJoin([type, characterFormat(message)]);
|
|
1402
|
-
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
|
|
1403
|
-
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
|
|
1404
|
-
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
|
|
1405
|
-
line += characterFormat(
|
|
1406
|
-
additional.length > 0 ? "\n" + additional.join("\n") : ""
|
|
1407
|
-
);
|
|
1408
|
-
if (logObj.type === "trace") {
|
|
1409
|
-
const _err = new Error("Trace: " + logObj.message);
|
|
1410
|
-
line += this.formatStack(_err.stack || "");
|
|
1411
|
-
}
|
|
1412
|
-
return isBadge ? "\n" + line + "\n" : line;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
function characterFormat(str) {
|
|
1416
|
-
return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
|
|
1417
|
-
}
|
|
1418
|
-
function getColor(color = "white") {
|
|
1419
|
-
return colors[color] || colors.white;
|
|
1420
|
-
}
|
|
1421
|
-
function getBgColor(color = "bgWhite") {
|
|
1422
|
-
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
function createConsola(options = {}) {
|
|
1426
|
-
let level = _getDefaultLogLevel();
|
|
1427
|
-
if (process.env.CONSOLA_LEVEL) {
|
|
1428
|
-
level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
|
|
1429
|
-
}
|
|
1430
|
-
const consola2 = createConsola$1({
|
|
1431
|
-
level,
|
|
1432
|
-
defaults: { level },
|
|
1433
|
-
stdout: process.stdout,
|
|
1434
|
-
stderr: process.stderr,
|
|
1435
|
-
prompt: (...args) => import('./chunks/prompt.mjs').then((m) => m.prompt(...args)),
|
|
1436
|
-
reporters: options.reporters || [
|
|
1437
|
-
options.fancy ?? !(T || A) ? new FancyReporter() : new BasicReporter()
|
|
1438
|
-
],
|
|
1439
|
-
...options
|
|
1440
|
-
});
|
|
1441
|
-
return consola2;
|
|
1442
|
-
}
|
|
1443
|
-
function _getDefaultLogLevel() {
|
|
1444
|
-
if (U) {
|
|
1445
|
-
return LogLevels.debug;
|
|
1446
|
-
}
|
|
1447
|
-
if (A) {
|
|
1448
|
-
return LogLevels.warn;
|
|
1449
|
-
}
|
|
1450
|
-
return LogLevels.info;
|
|
1451
|
-
}
|
|
1452
|
-
createConsola();
|
|
1
|
+
import { getAnsiColorFormatter as getAnsiColorFormatter$1, getConsoleSink as getConsoleSink$1, getTextFormatter as getTextFormatter$1, getLogger, configure } from '@logtape/logtape';
|
|
1453
2
|
|
|
1454
3
|
const normalizeDescriptors=(error)=>{
|
|
1455
4
|
CORE_ERROR_PROPS.forEach((propName)=>{
|
|
@@ -2755,69 +1304,159 @@ function safeStringify(object, {indentation} = {}) {
|
|
|
2755
1304
|
return JSON.stringify(object, safeStringifyReplacer(seen), indentation);
|
|
2756
1305
|
}
|
|
2757
1306
|
|
|
2758
|
-
const
|
|
2759
|
-
const lines = stack.split("\n").map((l) =>
|
|
1307
|
+
const parseStack = (stack) => {
|
|
1308
|
+
const lines = stack.split("\n").map((l) => {
|
|
1309
|
+
let replaced = l.trim().replace("file://", "");
|
|
1310
|
+
return replaced;
|
|
1311
|
+
});
|
|
2760
1312
|
return lines;
|
|
2761
1313
|
};
|
|
2762
|
-
function
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
if (
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
1314
|
+
function ident(value, identation = 2) {
|
|
1315
|
+
value = Array.isArray(value) ? value : value.split("\n");
|
|
1316
|
+
return value.map((l) => `${" ".repeat(identation)}${l}`).join("\n");
|
|
1317
|
+
}
|
|
1318
|
+
function loggable(error) {
|
|
1319
|
+
if (typeof error === "string") {
|
|
1320
|
+
return error;
|
|
1321
|
+
}
|
|
1322
|
+
if (error instanceof Error) {
|
|
1323
|
+
const mergedErr = mergeErrorCause(error);
|
|
1324
|
+
if (mergedErr.stack) {
|
|
1325
|
+
const stack = parseStack(mergedErr.stack);
|
|
1326
|
+
return mergedErr.message + "\n" + ident(stack.slice(1));
|
|
2771
1327
|
}
|
|
2772
|
-
return
|
|
1328
|
+
return mergedErr.message;
|
|
2773
1329
|
}
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
name: mergedErr.name
|
|
2788
|
-
};
|
|
2789
|
-
if (mergedErr.stack) {
|
|
2790
|
-
const stack = parseStack(mergedErr.stack);
|
|
2791
|
-
result.error.stack = stack.join("\n");
|
|
2792
|
-
result.message += "\n" + stack.slice(1).map((l) => " " + l).join("\n");
|
|
1330
|
+
return safeStringify(error);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
function errorFromLogRecord(record) {
|
|
1334
|
+
const errors = Object.values(record.properties).filter((v) => v instanceof Error).map((err) => {
|
|
1335
|
+
const mergedErr = mergeErrorCause(err);
|
|
1336
|
+
if (mergedErr.stack) {
|
|
1337
|
+
mergedErr.stack = parseStack(mergedErr.stack).join("\n");
|
|
1338
|
+
}
|
|
1339
|
+
return mergedErr;
|
|
1340
|
+
});
|
|
1341
|
+
if (errors.length === 0) {
|
|
1342
|
+
return null;
|
|
2793
1343
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
1344
|
+
return errors.length === 1 ? errors[0] : new AggregateError(errors);
|
|
1345
|
+
}
|
|
1346
|
+
function appendErrorToMessage(values, color = false) {
|
|
1347
|
+
const error = errorFromLogRecord(values.record);
|
|
1348
|
+
if (error) {
|
|
1349
|
+
let errorMessge = error.message;
|
|
1350
|
+
if (error.stack) {
|
|
1351
|
+
errorMessge = errorMessge + "\n" + ident(error.stack.split("\n").slice(1));
|
|
1352
|
+
}
|
|
1353
|
+
if (color) {
|
|
1354
|
+
errorMessge = `RED: ${ansiColors.red}${errorMessge}${RESET}`;
|
|
1355
|
+
}
|
|
1356
|
+
return {
|
|
1357
|
+
...values,
|
|
1358
|
+
message: values.message + "\n" + ident(errorMessge)
|
|
1359
|
+
};
|
|
2796
1360
|
}
|
|
2797
|
-
return
|
|
1361
|
+
return values;
|
|
1362
|
+
}
|
|
1363
|
+
const levelAbbreviations = {
|
|
1364
|
+
"debug": "DEBUG",
|
|
1365
|
+
"info": "INFO ",
|
|
1366
|
+
"warning": "WARN ",
|
|
1367
|
+
"error": "ERROR",
|
|
1368
|
+
"fatal": "FATAL"
|
|
1369
|
+
};
|
|
1370
|
+
function getMessageOnlyFormatter() {
|
|
1371
|
+
return getTextFormatter({
|
|
1372
|
+
format: ({ message }) => {
|
|
1373
|
+
return message;
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
const level = (l) => levelAbbreviations[l];
|
|
1378
|
+
function getTextFormatter(options) {
|
|
1379
|
+
const format = options?.format ?? (({ timestamp, level: level2, category, message }) => {
|
|
1380
|
+
return `${timestamp} ${level2} ${category} ${message}`;
|
|
1381
|
+
});
|
|
1382
|
+
return getTextFormatter$1({
|
|
1383
|
+
timestamp: "time",
|
|
1384
|
+
level,
|
|
1385
|
+
category: ".",
|
|
1386
|
+
...options,
|
|
1387
|
+
format: (values) => format(appendErrorToMessage(values))
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
const RESET = "\x1B[0m";
|
|
1391
|
+
const ansiColors = {
|
|
1392
|
+
// black: "\x1b[30m",
|
|
1393
|
+
red: "\x1B[31m"
|
|
1394
|
+
// green: "\x1b[32m",
|
|
1395
|
+
// yellow: "\x1b[33m",
|
|
1396
|
+
// blue: "\x1b[34m",
|
|
1397
|
+
// magenta: "\x1b[35m",
|
|
1398
|
+
// cyan: "\x1b[36m",
|
|
1399
|
+
// white: "\x1b[37m",
|
|
1400
|
+
};
|
|
1401
|
+
function getAnsiColorFormatter(options) {
|
|
1402
|
+
const format = options?.format ?? (({ timestamp, level: level2, category, message }) => {
|
|
1403
|
+
return `${timestamp} ${level2} ${category} ${message}`;
|
|
1404
|
+
});
|
|
1405
|
+
return getAnsiColorFormatter$1({
|
|
1406
|
+
timestamp: "time",
|
|
1407
|
+
level,
|
|
1408
|
+
categoryStyle: "bold",
|
|
1409
|
+
categoryColor: "cyan",
|
|
1410
|
+
category: ".",
|
|
1411
|
+
...options,
|
|
1412
|
+
format: (values) => {
|
|
1413
|
+
return format(appendErrorToMessage(values, true));
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
function getConsoleSink(options) {
|
|
1418
|
+
return getConsoleSink$1({
|
|
1419
|
+
formatter: getAnsiColorFormatter(),
|
|
1420
|
+
...options
|
|
1421
|
+
});
|
|
2798
1422
|
}
|
|
2799
1423
|
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
1424
|
+
const logger = getLogger("likec4");
|
|
1425
|
+
function createLogger(subcategory) {
|
|
1426
|
+
return logger.getChild(subcategory);
|
|
1427
|
+
}
|
|
1428
|
+
let configureWasCalled = false;
|
|
1429
|
+
async function configureLogger(config) {
|
|
1430
|
+
try {
|
|
1431
|
+
configureWasCalled = true;
|
|
1432
|
+
const sinks = config?.sinks ?? {};
|
|
1433
|
+
await configure({
|
|
1434
|
+
...config,
|
|
1435
|
+
sinks: {
|
|
1436
|
+
...sinks,
|
|
1437
|
+
// @ts-expect-error console is not a valid sink id
|
|
1438
|
+
console: sinks["console"] ?? getConsoleSink()
|
|
1439
|
+
},
|
|
1440
|
+
loggers: [
|
|
1441
|
+
{ category: ["logtape", "meta"], sinks: ["console"], lowestLevel: "warning" },
|
|
1442
|
+
...config?.loggers ?? [
|
|
1443
|
+
{
|
|
1444
|
+
category: "likec4",
|
|
1445
|
+
sinks: ["console"],
|
|
1446
|
+
lowestLevel: "debug"
|
|
1447
|
+
}
|
|
1448
|
+
]
|
|
1449
|
+
]
|
|
1450
|
+
});
|
|
1451
|
+
} catch (e) {
|
|
1452
|
+
console.error(e);
|
|
1453
|
+
}
|
|
2804
1454
|
}
|
|
2805
|
-
function
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
const consola = createConsola({
|
|
2810
|
-
level,
|
|
2811
|
-
defaults: {
|
|
2812
|
-
level
|
|
2813
|
-
},
|
|
2814
|
-
throttle: 2,
|
|
2815
|
-
throttleMin: 500,
|
|
2816
|
-
formatOptions: {
|
|
2817
|
-
colors: true,
|
|
2818
|
-
compact: false,
|
|
2819
|
-
date: false
|
|
1455
|
+
function ensureLoggerIsConfigured() {
|
|
1456
|
+
if (!configureWasCalled) {
|
|
1457
|
+
configureLogger();
|
|
1458
|
+
console.warn("logger automatically configured with default settings");
|
|
2820
1459
|
}
|
|
2821
|
-
}
|
|
1460
|
+
}
|
|
2822
1461
|
|
|
2823
|
-
export {
|
|
1462
|
+
export { configureLogger, logger as consola, createLogger, ensureLoggerIsConfigured, errorFromLogRecord, getAnsiColorFormatter, getConsoleSink, getMessageOnlyFormatter, getTextFormatter, loggable, logger, logger as rootLogger };
|