@substrate-system/debug 0.9.22 → 0.9.24
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 +70 -13
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.d.ts +1 -4
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js.map +2 -2
- package/dist/node/index.min.cjs +1 -1
- package/dist/node/index.min.cjs.map +2 -2
- package/dist/node/index.min.js +3 -3
- package/dist/node/index.min.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* [x] Node
|
|
12
12
|
* [x] browsers
|
|
13
13
|
|
|
14
|
-
A tiny JavaScript debugging utility that works in Node
|
|
15
|
-
Use environment variables to control logging in Node
|
|
14
|
+
A tiny JavaScript debugging utility that works in Node and browsers.
|
|
15
|
+
Use environment variables to control logging in Node, and `localStorage`
|
|
16
16
|
in browsers. Keep your ridiculous console log statements out of production.
|
|
17
17
|
|
|
18
18
|
This is based on [debug](https://github.com/debug-js/debug).
|
|
19
19
|
It's been rewritten to use contemporary JS.
|
|
20
20
|
|
|
21
|
-
In the browser, this uses localStorage
|
|
22
|
-
In Node
|
|
21
|
+
In the browser, this uses localStorage key `'DEBUG'`.
|
|
22
|
+
In Node, it uses the environment variable `DEBUG`.
|
|
23
23
|
|
|
24
24
|
**Featuring:**
|
|
25
25
|
* Use [exports](https://github.com/substrate-system/debug/blob/main/package.json#L31)
|
|
@@ -36,12 +36,14 @@ generated by typescript.
|
|
|
36
36
|
- [Install](#install)
|
|
37
37
|
- [Browser](#browser)
|
|
38
38
|
* [Factor out of production](#factor-out-of-production)
|
|
39
|
+
* [HTML `importmap`](#html-importmap)
|
|
39
40
|
- [Cloudflare](#cloudflare)
|
|
40
41
|
- [Node JS](#node-js)
|
|
41
42
|
- [Config](#config)
|
|
42
43
|
* [Namespace](#namespace)
|
|
43
44
|
* [Enable all namespaces](#enable-all-namespaces)
|
|
44
45
|
* [Enable specific namespaces](#enable-specific-namespaces)
|
|
46
|
+
* [Boolean](#boolean)
|
|
45
47
|
* [Extend](#extend)
|
|
46
48
|
- [Develop](#develop)
|
|
47
49
|
* [browser](#browser)
|
|
@@ -84,21 +86,60 @@ debug('hello logs')
|
|
|
84
86
|
Use [dynamic imoprts](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import)
|
|
85
87
|
to keep this entirely out of production code, so your bundle is smaller.
|
|
86
88
|
|
|
89
|
+
You would need to either build this module to the right path, or copy the
|
|
90
|
+
bundled JS included here:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
cp ./node_modules/@substrate-system/debug/dist/browser/index.min.js ./public/debug.js
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Dynamic Imports
|
|
97
|
+
|
|
98
|
+
> [!NOTE]
|
|
99
|
+
> We export `noop` here; it has the same type signature as `debug`.
|
|
100
|
+
|
|
87
101
|
```ts
|
|
88
|
-
import {
|
|
89
|
-
import { noop } from '@substrate-system/debug/noop'
|
|
102
|
+
import { type Debug, noop } from '@substrate-system/debug/noop'
|
|
90
103
|
|
|
91
|
-
let debug:
|
|
104
|
+
let debug:ReturnType<typeof Debug> = noop
|
|
92
105
|
if (import.meta.env.DEV) {
|
|
93
|
-
const Debug = await import('/example/debug.js')
|
|
106
|
+
const Debug = await import('/example-path/debug.js')
|
|
94
107
|
debug = Debug('myApplication:abc')
|
|
95
|
-
} else {
|
|
96
|
-
debug = noop // this is a function matching the signature for Debugger
|
|
97
108
|
}
|
|
98
109
|
```
|
|
99
110
|
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
### HTML `importmap`
|
|
112
|
+
|
|
113
|
+
Or use the HTML [importmap script tag](https://www.honeybadger.io/blog/import-maps/)
|
|
114
|
+
to replace this in production. In these examples, you would need to build this
|
|
115
|
+
module or copy the minified JS file to the right directory.
|
|
116
|
+
|
|
117
|
+
#### Development
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<script type="importmap">
|
|
121
|
+
{
|
|
122
|
+
"imports": {
|
|
123
|
+
"@substrate-system/debug": "/example-path/debug.js",
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Production
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<script type="importmap">
|
|
133
|
+
{
|
|
134
|
+
"imports": {
|
|
135
|
+
"@substrate-system/debug": "data:text/javascript,export default function(){return()=>{}}"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
</script>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
> [!TIP]
|
|
142
|
+
> Using a `data:` URL means no network request at all for the noop.
|
|
102
143
|
|
|
103
144
|
## Cloudflare
|
|
104
145
|
|
|
@@ -157,6 +198,19 @@ localStorage.setItem('DEBUG', '*')
|
|
|
157
198
|
localStorage.setItem('DEBUG', 'myapp:auth,myapp:api,myapp:api:*')
|
|
158
199
|
```
|
|
159
200
|
|
|
201
|
+
### Boolean
|
|
202
|
+
|
|
203
|
+
Pass in a boolean to enable or disable the `debug` instance. This will log
|
|
204
|
+
with a random color.
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
import Debug from '@substrate-system/debug'
|
|
208
|
+
const debug = Debug(import.meta.env.DEV) // for vite dev server
|
|
209
|
+
|
|
210
|
+
debug('hello')
|
|
211
|
+
// => DEV hello
|
|
212
|
+
```
|
|
213
|
+
|
|
160
214
|
### Extend
|
|
161
215
|
|
|
162
216
|
You can extend the debugger to create new debug instances with new namespaces:
|
|
@@ -168,6 +222,8 @@ const log = Debug('auth')
|
|
|
168
222
|
const logSign = log.extend('sign')
|
|
169
223
|
const logLogin = log.extend('login')
|
|
170
224
|
|
|
225
|
+
window.localStorage.setItem('DEBUG', 'auth,auth:*')
|
|
226
|
+
|
|
171
227
|
log('hello') // auth hello
|
|
172
228
|
logSign('hello') // auth:sign hello
|
|
173
229
|
logLogin('hello') // auth:login hello
|
|
@@ -177,7 +233,7 @@ Chained extending is also supported:
|
|
|
177
233
|
|
|
178
234
|
```js
|
|
179
235
|
const logSignVerbose = logSign.extend('verbose')
|
|
180
|
-
logSignVerbose('hello')
|
|
236
|
+
logSignVerbose('hello') // auth:sign:verbose hello
|
|
181
237
|
```
|
|
182
238
|
|
|
183
239
|
------------------------------------------------------------------
|
|
@@ -186,6 +242,7 @@ logSignVerbose('hello') // auth:sign:verbose hello
|
|
|
186
242
|
## Develop
|
|
187
243
|
|
|
188
244
|
### browser
|
|
245
|
+
|
|
189
246
|
Start a `vite` server and log some things. This uses
|
|
190
247
|
[the example directory](./example/).
|
|
191
248
|
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/node/index.ts"],
|
|
4
|
-
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA0B;AAC1B,sBAAgB;AAChB,uBAAiB;AACjB,
|
|
4
|
+
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar,\n type Debugger\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (\n namespace?:string|null,\n env?:Record<string, any>\n):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA0B;AAC1B,sBAAgB;AAChB,uBAAiB;AACjB,eAKO;AACP,gBAAe;AAEf,0BAAc,wBAXd;AAAA,CAaC,WAAY;AACT,MAAI,OAAO,SAAS,eAAe,OAAO,WAAW,UAAU;AAE3D,WAAO,OAAO;AAAA,EAClB;AACJ,GAAG;AAEH,MAAM,SAAmB,sBAAAA;AAAA,CAEpB,sBAAAA,QAAc,UAAU,sBAAAA,SAAe,SAAS,IAAM;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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package/dist/node/index.d.ts
CHANGED
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAIH,KAAK,QAAQ,EAChB,MAAM,aAAa,CAAA;AAGpB,cAAc,aAAa,CAAA;AAsI3B;;;;;GAKG;AACH,wBAAgB,WAAW,CACvB,SAAS,CAAC,EAAC,MAAM,GAAC,IAAI,EACtB,GAAG,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,QAAQ,CAmBT;yBAtBe,WAAW;+BAwBiB,MAAM;;AAIlD,eAAe,WAAW,CAAA"}
|
package/dist/node/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/node/index.ts"],
|
|
4
|
-
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\
|
|
5
|
-
"mappings": ";;AAAA,OAAO,mBAAmB;AAC1B,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar,\n type Debugger\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (\n namespace?:string|null,\n env?:Record<string, any>\n):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA,OAAO,mBAAmB;AAC1B,OAAO,SAAS;AAChB,OAAO,UAAU;AACjB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OAEG;AACP,OAAO,QAAQ;AAEf,cAAc;AAAA,CAEb,WAAY;AACT,MAAI,OAAO,SAAS,eAAe,OAAO,WAAW,UAAU;AAE3D,WAAO,OAAO;AAAA,EAClB;AACJ,GAAG;AAEH,MAAM,SAAmB;AAAA,CAEpB,cAAc,UAAU,eAAe,SAAS,IAAM;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var B=Object.create;var l=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var s=(e,r)=>l(e,"name",{value:r,configurable:!0});var Y=(e,r)=>{for(var t in r)l(e,t,{get:r[t],enumerable:!0})},w=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of v(r))!P.call(e,o)&&o!==t&&l(e,o,{get:()=>r[o],enumerable:!(n=V(r,o))||n.enumerable});return e};var m=(e,r,t)=>(t=e!=null?B(G(e)):{},w(r||!e||!e.__esModule?l(t,"default",{value:e,enumerable:!0}):t,e)),k=e=>w(l({},"__esModule",{value:!0}),e);var se={};Y(se,{coerce:()=>O,createDebug:()=>d,createRegexFromEnvVar:()=>y,default:()=>ee,generateRandomString:()=>T,selectColor:()=>H});module.exports=k(se);var
|
|
1
|
+
"use strict";var B=Object.create;var l=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var s=(e,r)=>l(e,"name",{value:r,configurable:!0});var Y=(e,r)=>{for(var t in r)l(e,t,{get:r[t],enumerable:!0})},w=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of v(r))!P.call(e,o)&&o!==t&&l(e,o,{get:()=>r[o],enumerable:!(n=V(r,o))||n.enumerable});return e};var m=(e,r,t)=>(t=e!=null?B(G(e)):{},w(r||!e||!e.__esModule?l(t,"default",{value:e,enumerable:!0}):t,e)),k=e=>w(l({},"__esModule",{value:!0}),e);var se={};Y(se,{coerce:()=>O,createDebug:()=>d,createRegexFromEnvVar:()=>y,default:()=>ee,generateRandomString:()=>T,selectColor:()=>H});module.exports=k(se);var g=m(require("node:process"),1),N=m(require("node:os"),1),E=m(require("node:tty"),1);function a(e,r=globalThis.Deno?globalThis.Deno.args:g.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),o=r.indexOf("--");return n!==-1&&(o===-1||n<o)}s(a,"hasFlag");var{env:i}=g.default,p;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?p=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(p=1);function U(){if(!("FORCE_COLOR"in i))return;if(i.FORCE_COLOR==="true")return 1;if(i.FORCE_COLOR==="false")return 0;if(i.FORCE_COLOR.length===0)return 1;let e=Math.min(Number.parseInt(i.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}s(U,"envForceColor");function j(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}s(j,"translateLevel");function $(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let n=U();n!==void 0&&(p=n);let o=t?p:n;if(o===0)return 0;if(t){if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2}if("TF_BUILD"in i&&"AGENT_NAME"in i)return 1;if(e&&!r&&o===void 0)return 0;let c=o||0;if(i.TERM==="dumb")return c;if(g.default.platform==="win32"){let u=N.default.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in i)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(u=>u in i)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in i)||i.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM==="truecolor"||i.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in i){let u=Number.parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:c}s($,"_supportsColor");function A(e,r={}){let t=$(e,{streamIsTTY:e&&e.isTTY,...r});return j(t)}s(A,"createSupportsColor");var z={stdout:A({isTTY:E.default.isatty(1)}),stderr:A({isTTY:E.default.isatty(2)})},h=z;var D=m(require("node:tty"),1),R=m(require("node:util"),1);function O(e){return e instanceof Error?e.stack||e.message:String(e)}s(O,"coerce");function H(e,r){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r[Math.abs(t)%r.length]}s(H,"selectColor");function y(e){return e.split(/[\s,]+/).filter(Boolean).map(n=>n.replace(/\*/g,".*?")).map(n=>new RegExp("^"+n+"$"))}s(y,"createRegexFromEnvVar");function T(e=6){return Math.random().toString(20).substring(2,e)}s(T,"generateRandomString");function x(e,r={}){r=r||{};let t=typeof e;if(t==="string"&&e.length>0)return J(e);if(t==="number"&&isFinite(e))return r.long?W(e):K(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}s(x,"default");function J(e){if(e=String(e),e.length>100)return;let r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r)return;let t=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*315576e5;case"weeks":case"week":case"w":return t*6048e5;case"days":case"day":case"d":return t*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return t*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return t*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return t*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}s(J,"parse");function K(e){let r=Math.abs(e);return r>=864e5?Math.round(e/864e5)+"d":r>=36e5?Math.round(e/36e5)+"h":r>=6e4?Math.round(e/6e4)+"m":r>=1e3?Math.round(e/1e3)+"s":e+"ms"}s(K,"fmtShort");function W(e){let r=Math.abs(e);return r>=864e5?b(e,r,864e5,"day"):r>=36e5?b(e,r,36e5,"hour"):r>=6e4?b(e,r,6e4,"minute"):r>=1e3?b(e,r,1e3,"second"):e+" ms"}s(W,"fmtLong");function b(e,r,t,n){let o=r>=t*1.5;return Math.round(e/t)+" "+n+(o?"s":"")}s(b,"plural");(function(){typeof self>"u"&&typeof global=="object"&&(global.self=global)})();var Z=h&&(h.stderr||h).level>=2?[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]:[6,2,3,4,5,1];function _(){return D.default.isatty(process.stderr.fd)||!!process.env.FORCE_COLOR}s(_,"shouldUseColors");function q(){return new Date().toISOString()}s(q,"getDate");function Q(...e){return process.stderr.write(R.default.format(...e)+`
|
|
2
2
|
`)}s(Q,"log");function X(e,r={}){return{o:s(function(t){return R.default.inspect(t,Object.assign({},r,{colors:e})).split(`
|
|
3
3
|
`).map(n=>n.trim()).join(" ")},"o"),O:s(function(t){return R.default.inspect(t,Object.assign({},r,{colors:_()}))},"O")}}s(X,"createFormatters");var M="";function d(e,r){let t=Number(new Date);M||(M=T(10));let n=e||M,o=oe(n,Z);function c(...u){if(te(e,r))return re(e||"DEV",u,{prevTime:t,color:o})}return s(c,"debug"),c.extend=function(u){let f=n+":"+u;return d(f,r)},c}s(d,"createDebug");d.shouldLog=function(e){return e&&(e==="development"||e==="test")};var ee=d;function re(e,r,{prevTime:t,color:n}){let o=Number(new Date),c=o-(t||o);t=o,r[0]=O(r[0]);let u=X(_());typeof r[0]!="string"&&r.unshift("%O");let f=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(C,F)=>{if(C==="%%")return"%";f++;let I=u[F];if(typeof I=="function"){let S=r[f];C=I.call(self,S),r.splice(f,1),f--}return C});let L=ne({diff:c,color:n,useColors:_(),namespace:e},r);Q(...L)}s(re,"logger");function te(e,r){let t=r||process.env;return e?t.DEBUG?y(t.DEBUG).some(o=>o.test(e)):!1:!!d.shouldLog(t.NODE_ENV)}s(te,"isEnabled");function ne({diff:e,color:r,namespace:t,useColors:n},o){if(o=o||[],n){let c=r,u="\x1B[3"+(c<8?c:"8;5;"+c),f=` ${u};1m${t} \x1B[0m`;o[0]=f+o[0].split(`
|
|
4
4
|
`).join(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/node/index.ts", "../../node_modules/supports-color/index.js", "../../src/index.ts", "../../src/ms.ts"],
|
|
4
|
-
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\nexport interface Debugger {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (namespace?:string|null, env?:Record<string, any>):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension: string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n* Coerce `val`.\n*\n* @param {unknown} val\n* @return {string}\n*/\nexport function coerce (val:unknown):string {\n if (val instanceof Error) {\n return val.stack || val.message\n }\n\n return String(val)\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @return {number|string} An ANSI color code for the given namespace\n */\nexport function selectColor (\n namespace:string,\n colors:string[]|number[]\n):number|string {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n\nexport function createRegexFromEnvVar (names:string):RegExp[] {\n const split = names.split(/[\\s,]+/).filter(Boolean)\n const regexs = split\n .map(word => word.replace(/\\*/g, '.*?'))\n .map(r => new RegExp('^' + r + '$'))\n\n return regexs\n}\n\nexport type Debugger = {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Use this to create a random namespace in the case that `debug`\n * is called without any arguments.\n * @param {number} length Lenght of the random string\n * @returns {string}\n */\nexport function generateRandomString (length = 6):string {\n return Math.random().toString(20).substring(2, length)\n}\n", "/**\n * Helpers.\n */\n\nconst s = 1000\nconst m = s * 60\nconst h = m * 60\nconst d = h * 24\nconst w = d * 7\nconst y = d * 365.25\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nexport default function (val, options:{ long?:boolean } = {}) {\n options = options || {}\n const type = typeof val\n if (type === 'string' && val.length > 0) {\n return parse(val)\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val)\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n )\n}\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse (str) {\n str = String(str)\n if (str.length > 100) {\n return\n }\n const match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n )\n if (!match) {\n return\n }\n const n = parseFloat(match[1])\n const type = (match[2] || 'ms').toLowerCase()\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y\n case 'weeks':\n case 'week':\n case 'w':\n return n * w\n case 'days':\n case 'day':\n case 'd':\n return n * d\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n\n default:\n return undefined\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd'\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h'\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm'\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's'\n }\n return ms + 'ms'\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day')\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour')\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute')\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second')\n }\n return ms + ' ms'\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural (ms, msAbs, n, name) {\n const isPlural = msAbs >= n * 1.5\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '')\n}\n"],
|
|
5
|
-
"mappings": "6mBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,YAAAE,EAAA,gBAAAC,EAAA,0BAAAC,EAAA,YAAAC,GAAA,yBAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAR,ICAA,IAAAS,EAAoB,6BACpBC,EAAe,wBACfC,EAAgB,yBAIhB,SAASC,EAAQC,EAAMC,EAAO,WAAW,KAAO,WAAW,KAAK,KAAO,EAAAC,QAAQ,KAAM,CACpF,IAAMC,EAASH,EAAK,WAAW,GAAG,EAAI,GAAMA,EAAK,SAAW,EAAI,IAAM,KAChEI,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AAMC,EAAQ,KAAK,IAAID,CAAE,EACzB,OAAIC,GAAS,MACFC,EAAOF,EAAIC,EAAO,MAAG,KAAK,EAEjCA,GAAS,KACFC,EAAOF,EAAIC,EAAO,KAAG,MAAM,EAElCA,GAAS,IACFC,EAAOF,EAAIC,EAAO,IAAG,QAAQ,EAEpCA,GAAS,IACFC,EAAOF,EAAIC,EAAO,IAAG,QAAQ,EAEjCD,EAAK,KAChB,CAfSJ,EAAAF,EAAA,WAqBT,SAASQ,EAAQF,EAAIC,EAAOF,EAAGI,EAAM,CACjC,IAAMC,EAAWH,GAASF,EAAI,IAC9B,OAAO,KAAK,MAAMC,EAAKD,CAAC,EAAI,IAAMI,GAAQC,EAAW,IAAM,GAC/D,CAHSR,EAAAM,EAAA,
|
|
4
|
+
"sourcesContent": ["import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar,\n type Debugger\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (\n namespace?:string|null,\n env?:Record<string, any>\n):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n", "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "/**\n* Coerce `val`.\n*\n* @param {unknown} val\n* @return {string}\n*/\nexport function coerce (val:unknown):string {\n if (val instanceof Error) {\n return val.stack || val.message\n }\n\n return String(val)\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @return {number|string} An ANSI color code for the given namespace\n */\nexport function selectColor (\n namespace:string,\n colors:string[]|number[]\n):number|string {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n\nexport function createRegexFromEnvVar (names:string):RegExp[] {\n const split = names.split(/[\\s,]+/).filter(Boolean)\n const regexs = split\n .map(word => word.replace(/\\*/g, '.*?'))\n .map(r => new RegExp('^' + r + '$'))\n\n return regexs\n}\n\nexport type Debugger = {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Use this to create a random namespace in the case that `debug`\n * is called without any arguments.\n * @param {number} length Lenght of the random string\n * @returns {string}\n */\nexport function generateRandomString (length = 6):string {\n return Math.random().toString(20).substring(2, length)\n}\n", "/**\n * Helpers.\n */\n\nconst s = 1000\nconst m = s * 60\nconst h = m * 60\nconst d = h * 24\nconst w = d * 7\nconst y = d * 365.25\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nexport default function (val, options:{ long?:boolean } = {}) {\n options = options || {}\n const type = typeof val\n if (type === 'string' && val.length > 0) {\n return parse(val)\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val)\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n )\n}\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse (str) {\n str = String(str)\n if (str.length > 100) {\n return\n }\n const match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n )\n if (!match) {\n return\n }\n const n = parseFloat(match[1])\n const type = (match[2] || 'ms').toLowerCase()\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y\n case 'weeks':\n case 'week':\n case 'w':\n return n * w\n case 'days':\n case 'day':\n case 'd':\n return n * d\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n\n default:\n return undefined\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd'\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h'\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm'\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's'\n }\n return ms + 'ms'\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day')\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour')\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute')\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second')\n }\n return ms + ' ms'\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural (ms, msAbs, n, name) {\n const isPlural = msAbs >= n * 1.5\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '')\n}\n"],
|
|
5
|
+
"mappings": "6mBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,YAAAE,EAAA,gBAAAC,EAAA,0BAAAC,EAAA,YAAAC,GAAA,yBAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAR,ICAA,IAAAS,EAAoB,6BACpBC,EAAe,wBACfC,EAAgB,yBAIhB,SAASC,EAAQC,EAAMC,EAAO,WAAW,KAAO,WAAW,KAAK,KAAO,EAAAC,QAAQ,KAAM,CACpF,IAAMC,EAASH,EAAK,WAAW,GAAG,EAAI,GAAMA,EAAK,SAAW,EAAI,IAAM,KAChEI,EAAW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A,GAAQ,CAAC,EAEZG,EAAW,CACX,IAAM,EAAIW,EACJuB,EAAY,UAAc,EAAI,EAAI,EAAI,OAAS,GAC/CC,EAAS,KAAKD,CAAS,MAAM5B,CAAS,WAE5CT,EAAK,CAAC,EAAIsC,EAAStC,EAAK,CAAC,EAAE,MAAM;AAAA,CAAI,EAAE,KAAK;AAAA,EAAOsC,CAAM,EACzDtC,EAAK,KAAKqC,EAAY,KAAOE,EAAGf,CAAI,EAAI,SAAW,CACvD,MACIxB,EAAK,CAAC,EAAIF,EAAQ,EAAI,IAAMW,EAAY,IAAMT,EAAK,CAAC,EAGxD,OAAOA,CACX,CApBSH,EAAAoC,GAAA,cA4BT,SAASlB,GAAaN,EAAkBhB,EAAwB,CAC5D,IAAI+C,EAAO,EAEX,QAASC,EAAI,EAAGA,EAAIhC,EAAU,OAAQgC,IAClCD,GAASA,GAAQ,GAAKA,EAAQ/B,EAAU,WAAWgC,CAAC,EACpDD,GAAQ,EAGZ,OAAO/C,EAAO,KAAK,IAAI+C,CAAI,EAAI/C,EAAO,MAAM,CAChD,CATSI,EAAAkB,GAAA",
|
|
6
6
|
"names": ["index_exports", "__export", "coerce", "createDebug", "createRegexFromEnvVar", "index_default", "generateRandomString", "selectColor", "__toCommonJS", "import_node_process", "import_node_os", "import_node_tty", "hasFlag", "flag", "argv", "process", "prefix", "position", "terminatorPosition", "__name", "env", "flagForceColor", "envForceColor", "level", "translateLevel", "_supportsColor", "haveStream", "streamIsTTY", "sniffFlags", "noFlagForceColor", "forceColor", "min", "osRelease", "os", "key", "sign", "version", "createSupportsColor", "stream", "options", "supportsColor", "tty", "supports_color_default", "import_node_tty", "import_node_util", "coerce", "val", "__name", "selectColor", "namespace", "colors", "hash", "i", "createRegexFromEnvVar", "names", "word", "r", "generateRandomString", "length", "ms_default", "val", "options", "type", "parse", "fmtLong", "fmtShort", "__name", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "colors", "supports_color_default", "shouldUseColors", "tty", "__name", "getDate", "log", "args", "util", "createFormatters", "useColors", "inspectOpts", "v", "str", "randomNamespace", "createDebug", "namespace", "env", "prevTime", "generateRandomString", "_namespace", "color", "selectColor", "debug", "isEnabled", "logger", "extension", "extendedNamespace", "envString", "index_default", "curr", "diff", "coerce", "formatters", "index", "match", "format", "formatter", "val", "_args", "formatArgs", "_env", "createRegexFromEnvVar", "regex", "colorCode", "prefix", "ms_default", "hash", "i"]
|
|
7
7
|
}
|
package/dist/node/index.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var N=Object.defineProperty;var o=(e,r)=>N(e,"name",{value:r,configurable:!0});import h from"node:process";import D from"node:os";import y from"node:tty";function a(e,r=globalThis.Deno?globalThis.Deno.args:h.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),s=r.indexOf("--");return n!==-1&&(s===-1||n<s)}o(a,"hasFlag");var{env:i}=h,l;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?l=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(l=1);function L(){if(!("FORCE_COLOR"in i))return;if(i.FORCE_COLOR==="true")return 1;if(i.FORCE_COLOR==="false")return 0;if(i.FORCE_COLOR.length===0)return 1;let e=Math.min(Number.parseInt(i.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}o(L,"envForceColor");function F(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(F,"translateLevel");function S(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let n=L();n!==void 0&&(l=n);let s=t?l:n;if(s===0)return 0;if(t){if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2}if("TF_BUILD"in i&&"AGENT_NAME"in i)return 1;if(e&&!r&&s===void 0)return 0;let c=s||0;if(i.TERM==="dumb")return c;if(h.platform==="win32"){let u=D.release().split(".");return Number(u[0])>=10&&Number(u[2])>=10586?Number(u[2])>=14931?3:2:1}if("CI"in i)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(u=>u in i)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(u=>u in i)||i.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM==="truecolor"||i.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in i){let u=Number.parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:c}o(S,"_supportsColor");function T(e,r={}){let t=S(e,{streamIsTTY:e&&e.isTTY,...r});return F(t)}o(T,"createSupportsColor");var B={stdout:T({isTTY:y.isatty(1)}),stderr:T({isTTY:y.isatty(2)})},m=B;import P from"node:tty";import C from"node:util";function x(e){return e instanceof Error?e.stack||e.message:String(e)}o(x,"coerce");function ee(e,r){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r[Math.abs(t)%r.length]}o(ee,"selectColor");function M(e){return e.split(/[\s,]+/).filter(Boolean).map(n=>n.replace(/\*/g,".*?")).map(n=>new RegExp("^"+n+"$"))}o(M,"createRegexFromEnvVar");function _(e=6){return Math.random().toString(20).substring(2,e)}o(_,"generateRandomString");function b(e,r={}){r=r||{};let t=typeof e;if(t==="string"&&e.length>0)return V(e);if(t==="number"&&isFinite(e))return r.long?G(e):v(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}o(b,"default");function V(e){if(e=String(e),e.length>100)return;let r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r)return;let t=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*315576e5;case"weeks":case"week":case"w":return t*6048e5;case"days":case"day":case"d":return t*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return t*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return t*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return t*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}o(V,"parse");function v(e){let r=Math.abs(e);return r>=864e5?Math.round(e/864e5)+"d":r>=36e5?Math.round(e/36e5)+"h":r>=6e4?Math.round(e/6e4)+"m":r>=1e3?Math.round(e/1e3)+"s":e+"ms"}o(v,"fmtShort");function G(e){let r=Math.abs(e);return r>=864e5?d(e,r,864e5,"day"):r>=36e5?d(e,r,36e5,"hour"):r>=6e4?d(e,r,6e4,"minute"):r>=1e3?d(e,r,1e3,"second"):e+" ms"}o(G,"fmtLong");function d(e,r,t,n){let s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}o(d,"plural");(function(){typeof self>"u"&&typeof global=="object"&&(global.self=global)})();var Y=m&&(m.stderr||m).level>=2?[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]:[6,2,3,4,5,1];function E(){return P.isatty(process.stderr.fd)||!!process.env.FORCE_COLOR}o(E,"shouldUseColors");function k(){return new Date().toISOString()}o(k,"getDate");function U(...e){return process.stderr.write(C.format(...e)+`
|
|
2
2
|
`)}o(U,"log");function j(e,r={}){return{o:o(function(t){return C.inspect(t,Object.assign({},r,{colors:e})).split(`
|
|
3
|
-
`).map(n=>n.trim()).join(" ")},"o"),O:o(function(t){return C.inspect(t,Object.assign({},r,{colors:E()}))},"O")}}o(j,"createFormatters");var R="";function
|
|
3
|
+
`).map(n=>n.trim()).join(" ")},"o"),O:o(function(t){return C.inspect(t,Object.assign({},r,{colors:E()}))},"O")}}o(j,"createFormatters");var R="";function p(e,r){let t=Number(new Date);R||(R=_(10));let n=e||R,s=J(n,Y);function c(...u){if(z(e,r))return $(e||"DEV",u,{prevTime:t,color:s})}return o(c,"debug"),c.extend=function(u){let f=n+":"+u;return p(f,r)},c}o(p,"createDebug");p.shouldLog=function(e){return e&&(e==="development"||e==="test")};var fe=p;function $(e,r,{prevTime:t,color:n}){let s=Number(new Date),c=s-(t||s);t=s,r[0]=x(r[0]);let u=j(E());typeof r[0]!="string"&&r.unshift("%O");let f=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(g,w)=>{if(g==="%%")return"%";f++;let O=u[w];if(typeof O=="function"){let A=r[f];g=O.call(self,A),r.splice(f,1),f--}return g});let I=H({diff:c,color:n,useColors:E(),namespace:e},r);U(...I)}o($,"logger");function z(e,r){let t=r||process.env;return e?t.DEBUG?M(t.DEBUG).some(s=>s.test(e)):!1:!!p.shouldLog(t.NODE_ENV)}o(z,"isEnabled");function H({diff:e,color:r,namespace:t,useColors:n},s){if(s=s||[],n){let c=r,u="\x1B[3"+(c<8?c:"8;5;"+c),f=` ${u};1m${t} \x1B[0m`;s[0]=f+s[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+f),s.push(u+"m+"+b(e)+"\x1B[0m")}else s[0]=k()+" "+t+" "+s[0];return s}o(H,"formatArgs");function J(e,r){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r[Math.abs(t)%r.length]}o(J,"selectColor");export{x as coerce,
|
|
5
|
+
`+f),s.push(u+"m+"+b(e)+"\x1B[0m")}else s[0]=k()+" "+t+" "+s[0];return s}o(H,"formatArgs");function J(e,r){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r[Math.abs(t)%r.length]}o(J,"selectColor");export{x as coerce,p as createDebug,M as createRegexFromEnvVar,fe as default,_ as generateRandomString,ee as selectColor};
|
|
6
6
|
//# sourceMappingURL=index.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../node_modules/supports-color/index.js", "../../src/node/index.ts", "../../src/index.ts", "../../src/ms.ts"],
|
|
4
|
-
"sourcesContent": ["import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\nexport interface Debugger {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (namespace?:string|null, env?:Record<string, any>):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension: string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n", "/**\n* Coerce `val`.\n*\n* @param {unknown} val\n* @return {string}\n*/\nexport function coerce (val:unknown):string {\n if (val instanceof Error) {\n return val.stack || val.message\n }\n\n return String(val)\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @return {number|string} An ANSI color code for the given namespace\n */\nexport function selectColor (\n namespace:string,\n colors:string[]|number[]\n):number|string {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n\nexport function createRegexFromEnvVar (names:string):RegExp[] {\n const split = names.split(/[\\s,]+/).filter(Boolean)\n const regexs = split\n .map(word => word.replace(/\\*/g, '.*?'))\n .map(r => new RegExp('^' + r + '$'))\n\n return regexs\n}\n\nexport type Debugger = {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Use this to create a random namespace in the case that `debug`\n * is called without any arguments.\n * @param {number} length Lenght of the random string\n * @returns {string}\n */\nexport function generateRandomString (length = 6):string {\n return Math.random().toString(20).substring(2, length)\n}\n", "/**\n * Helpers.\n */\n\nconst s = 1000\nconst m = s * 60\nconst h = m * 60\nconst d = h * 24\nconst w = d * 7\nconst y = d * 365.25\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nexport default function (val, options:{ long?:boolean } = {}) {\n options = options || {}\n const type = typeof val\n if (type === 'string' && val.length > 0) {\n return parse(val)\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val)\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n )\n}\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse (str) {\n str = String(str)\n if (str.length > 100) {\n return\n }\n const match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n )\n if (!match) {\n return\n }\n const n = parseFloat(match[1])\n const type = (match[2] || 'ms').toLowerCase()\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y\n case 'weeks':\n case 'week':\n case 'w':\n return n * w\n case 'days':\n case 'day':\n case 'd':\n return n * d\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n\n default:\n return undefined\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd'\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h'\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm'\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's'\n }\n return ms + 'ms'\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day')\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour')\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute')\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second')\n }\n return ms + ' ms'\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural (ms, msAbs, n, name) {\n const isPlural = msAbs >= n * 1.5\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '')\n}\n"],
|
|
5
|
-
"mappings": "+EAAA,OAAOA,MAAa,eACpB,OAAOC,MAAQ,UACf,OAAOC,MAAS,WAIhB,SAASC,EAAQC,EAAMC,EAAO,WAAW,KAAO,WAAW,KAAK,KAAOC,EAAQ,KAAM,CACpF,IAAMC,EAASH,EAAK,WAAW,GAAG,EAAI,GAAMA,EAAK,SAAW,EAAI,IAAM,KAChEI,EAAWH,EAAK,QAAQE,EAASH,CAAI,EACrCK,EAAqBJ,EAAK,QAAQ,IAAI,EAC5C,OAAOG,IAAa,KAAOC,IAAuB,IAAMD,EAAWC,EACpE,CALSC,EAAAP,EAAA,WAOT,GAAM,CAAC,IAAAQ,CAAG,EAAIL,EAEVM,EAEHT,EAAQ,UAAU,GACfA,EAAQ,WAAW,GACnBA,EAAQ,aAAa,GACrBA,EAAQ,aAAa,EAExBS,EAAiB,GAEjBT,EAAQ,OAAO,GACZA,EAAQ,QAAQ,GAChBA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ASF,EAAI,IAC9B,OAAO,KAAK,MAAMC,EAAKD,CAAC,EAAI,IAAMI,GAAQC,EAAW,IAAM,GAC/D,CAHSR,EAAAM,EAAA,
|
|
4
|
+
"sourcesContent": ["import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif (!('FORCE_COLOR' in env)) {\n\t\treturn;\n\t}\n\n\tif (env.FORCE_COLOR === 'true') {\n\t\treturn 1;\n\t}\n\n\tif (env.FORCE_COLOR === 'false') {\n\t\treturn 0;\n\t}\n\n\tif (env.FORCE_COLOR.length === 0) {\n\t\treturn 1;\n\t}\n\n\tconst level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\n\tif (![0, 1, 2, 3].includes(level)) {\n\t\treturn;\n\t}\n\n\treturn level;\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n", "import supportsColor from 'supports-color'\nimport tty from 'node:tty'\nimport util from 'node:util'\nimport {\n generateRandomString,\n coerce,\n createRegexFromEnvVar,\n type Debugger\n} from '../index.js'\nimport ms from '../ms.js'\n\nexport * from '../index.js'\n\n(function () {\n if (typeof self === 'undefined' && typeof global === 'object') {\n // @ts-expect-error self\n global.self = global\n }\n})()\n\nconst colors:number[] = (supportsColor &&\n // @ts-expect-error ???\n (supportsColor.stderr || supportsColor).level >= 2) ? ([\n 20,\n 21,\n 26,\n 27,\n 32,\n 33,\n 38,\n 39,\n 40,\n 41,\n 42,\n 43,\n 44,\n 45,\n 56,\n 57,\n 62,\n 63,\n 68,\n 69,\n 74,\n 75,\n 76,\n 77,\n 78,\n 79,\n 80,\n 81,\n 92,\n 93,\n 98,\n 99,\n 112,\n 113,\n 128,\n 129,\n 134,\n 135,\n 148,\n 149,\n 160,\n 161,\n 162,\n 163,\n 164,\n 165,\n 166,\n 167,\n 168,\n 169,\n 170,\n 171,\n 172,\n 173,\n 178,\n 179,\n 184,\n 185,\n 196,\n 197,\n 198,\n 199,\n 200,\n 201,\n 202,\n 203,\n 204,\n 205,\n 206,\n 207,\n 208,\n 209,\n 214,\n 215,\n 220,\n 221\n ]) :\n ([6, 2, 3, 4, 5, 1])\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\nfunction shouldUseColors ():boolean {\n return tty.isatty(process.stderr.fd) || !!process.env.FORCE_COLOR\n}\n\nfunction getDate ():string {\n return new Date().toISOString()\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\nfunction log (...args:any[]):boolean {\n return process.stderr.write(util.format(...args) + '\\n')\n}\n\n/**\n * Mutate formatters\n * Map %o to `util.inspect()`, all on a single line.\n */\nfunction createFormatters (useColors:boolean, inspectOpts = {}) {\n return {\n o: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: useColors\n }))\n .split('\\n')\n .map(str => str.trim())\n .join(' ')\n },\n\n O: function (v) {\n return util.inspect(v, Object.assign({}, inspectOpts, {\n colors: shouldUseColors()\n }))\n }\n }\n}\n\nlet randomNamespace:string = ''\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {string} namespace\n * @return {Function}\n */\nexport function createDebug (\n namespace?:string|null,\n env?:Record<string, any>\n):Debugger {\n // eslint-disable-next-line\n let prevTime = Number(new Date())\n if (!randomNamespace) randomNamespace = generateRandomString(10)\n const _namespace = namespace || randomNamespace\n const color = selectColor(_namespace, colors)\n\n function debug (...args:any[]) {\n if (isEnabled(namespace, env)) {\n return logger(namespace || 'DEV', args, { prevTime, color })\n }\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = _namespace + ':' + extension\n return createDebug(extendedNamespace, env)\n }\n\n return debug as Debugger\n}\n\ncreateDebug.shouldLog = function (envString:string) {\n return (envString && (envString === 'development' || envString === 'test'))\n}\n\nexport default createDebug\n\nfunction logger (namespace:string, args:any[], { prevTime, color }) {\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters(shouldUseColors())\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped % then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\n/**\n * Check if the given namespace is enabled.\n */\nfunction isEnabled (namespace?:string|null, _env?:Record<string, string>):boolean {\n const env = _env || process.env\n\n // if no namespace, and we are in dev mode\n if (!namespace) {\n return !!createDebug.shouldLog(env.NODE_ENV!)\n }\n\n // there is a namespace\n if (!env.DEBUG) return false // if no env DEBUG mode\n\n // else check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(env.DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]):string[] {\n args = args || []\n\n if (useColors) {\n const c = color\n const colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c)\n const prefix = ` ${colorCode};1m${namespace} \\u001B[0m`\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix)\n args.push(colorCode + 'm+' + ms(diff) + '\\u001B[0m')\n } else {\n args[0] = getDate() + ' ' + namespace + ' ' + args[0]\n }\n\n return args\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @param {number[]} colors The namespace string for the debug instance to be colored\n * @return {number} An ANSI color code for the given namespace\n */\nfunction selectColor (namespace:string, colors:number[]):number {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n", "/**\n* Coerce `val`.\n*\n* @param {unknown} val\n* @return {string}\n*/\nexport function coerce (val:unknown):string {\n if (val instanceof Error) {\n return val.stack || val.message\n }\n\n return String(val)\n}\n\n/**\n * Selects a color for a debug namespace\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @return {number|string} An ANSI color code for the given namespace\n */\nexport function selectColor (\n namespace:string,\n colors:string[]|number[]\n):number|string {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n\nexport function createRegexFromEnvVar (names:string):RegExp[] {\n const split = names.split(/[\\s,]+/).filter(Boolean)\n const regexs = split\n .map(word => word.replace(/\\*/g, '.*?'))\n .map(r => new RegExp('^' + r + '$'))\n\n return regexs\n}\n\nexport type Debugger = {\n (...args: any[]): void;\n extend: (namespace: string) => Debugger;\n}\n\n/**\n * Use this to create a random namespace in the case that `debug`\n * is called without any arguments.\n * @param {number} length Lenght of the random string\n * @returns {string}\n */\nexport function generateRandomString (length = 6):string {\n return Math.random().toString(20).substring(2, length)\n}\n", "/**\n * Helpers.\n */\n\nconst s = 1000\nconst m = s * 60\nconst h = m * 60\nconst d = h * 24\nconst w = d * 7\nconst y = d * 365.25\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nexport default function (val, options:{ long?:boolean } = {}) {\n options = options || {}\n const type = typeof val\n if (type === 'string' && val.length > 0) {\n return parse(val)\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val)\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n )\n}\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse (str) {\n str = String(str)\n if (str.length > 100) {\n return\n }\n const match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n )\n if (!match) {\n return\n }\n const n = parseFloat(match[1])\n const type = (match[2] || 'ms').toLowerCase()\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y\n case 'weeks':\n case 'week':\n case 'w':\n return n * w\n case 'days':\n case 'day':\n case 'd':\n return n * d\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n\n default:\n return undefined\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd'\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h'\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm'\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's'\n }\n return ms + 'ms'\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day')\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour')\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute')\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second')\n }\n return ms + ' ms'\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural (ms, msAbs, n, name) {\n const isPlural = msAbs >= n * 1.5\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '')\n}\n"],
|
|
5
|
+
"mappings": "+EAAA,OAAOA,MAAa,eACpB,OAAOC,MAAQ,UACf,OAAOC,MAAS,WAIhB,SAASC,EAAQC,EAAMC,EAAO,WAAW,KAAO,WAAW,KAAK,KAAOC,EAAQ,KAAM,CACpF,IAAMC,EAASH,EAAK,WAAW,GAAG,EAAI,GAAMA,EAAK,SAAW,EAAI,IAAM,KAChEI,EAAWH,EAAK,QAAQE,EAASH,CAAI,EACrCK,EAAqBJ,EAAK,QAAQ,IAAI,EAC5C,OAAOG,IAAa,KAAOC,IAAuB,IAAMD,EAAWC,EACpE,CALSC,EAAAP,EAAA,WAOT,GAAM,CAAC,IAAAQ,CAAG,EAAIL,EAEVM,EAEHT,EAAQ,UAAU,GACfA,EAAQ,WAAW,GACnBA,EAAQ,aAAa,GACrBA,EAAQ,aAAa,EAExBS,EAAiB,GAEjBT,EAAQ,OAAO,GACZA,EAAQ,QAAQ,GAChBA,EAAQ,YAAY,GACpBA,EAAQ,cAAc,KAEzBS,EAAiB,GAGlB,SAASC,GAAgB,CACxB,GAAI,EAAE,gBAAiBF,GACtB,OAGD,GAAIA,EAAI,cAAgB,OACvB,MAAO,GAGR,GAAIA,EAAI,cAAgB,QACv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AQ/B,EAAU,WAAWgC,CAAC,EACpDD,GAAQ,EAGZ,OAAO/C,EAAO,KAAK,IAAI+C,CAAI,EAAI/C,EAAO,MAAM,CAChD,CATSI,EAAAkB,EAAA",
|
|
6
6
|
"names": ["process", "os", "tty", "hasFlag", "flag", "argv", "process", "prefix", "position", "terminatorPosition", "__name", "env", "flagForceColor", "envForceColor", "level", "translateLevel", "_supportsColor", "haveStream", "streamIsTTY", "sniffFlags", "noFlagForceColor", "forceColor", "min", "osRelease", "os", "key", "sign", "version", "createSupportsColor", "stream", "options", "supportsColor", "tty", "supports_color_default", "tty", "util", "coerce", "val", "__name", "selectColor", "namespace", "colors", "hash", "i", "createRegexFromEnvVar", "names", "word", "r", "generateRandomString", "length", "ms_default", "val", "options", "type", "parse", "fmtLong", "fmtShort", "__name", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "colors", "supports_color_default", "shouldUseColors", "tty", "__name", "getDate", "log", "args", "util", "createFormatters", "useColors", "inspectOpts", "v", "str", "randomNamespace", "createDebug", "namespace", "env", "prevTime", "generateRandomString", "_namespace", "color", "selectColor", "debug", "isEnabled", "logger", "extension", "extendedNamespace", "envString", "index_default", "curr", "diff", "coerce", "formatters", "index", "match", "format", "formatter", "val", "_args", "formatArgs", "_env", "createRegexFromEnvVar", "regex", "colorCode", "prefix", "ms_default", "hash", "i"]
|
|
7
7
|
}
|