@substrate-system/debug 0.9.15 → 0.9.18
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 +17 -1
- package/dist/browser/index.cjs.map +2 -2
- package/dist/browser/index.d.ts +1 -4
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/browser/index.min.cjs.map +2 -2
- package/dist/browser/index.min.js.map +2 -2
- package/dist/cloudflare/index.cjs +136 -149
- package/dist/cloudflare/index.cjs.map +4 -4
- package/dist/cloudflare/index.d.ts +3 -5
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +134 -160
- package/dist/cloudflare/index.js.map +4 -4
- package/dist/cloudflare/index.min.cjs +1 -1
- package/dist/cloudflare/index.min.cjs.map +4 -4
- package/dist/cloudflare/index.min.js +1 -1
- package/dist/cloudflare/index.min.js.map +4 -4
- package/dist/common.d.ts +4 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/meta.json +2 -2
- package/dist/node.cjs.map +2 -2
- package/dist/node.js.map +2 -2
- package/dist/node.min.cjs +3 -3
- package/dist/node.min.cjs.map +2 -2
- package/dist/node.min.js.map +2 -2
- package/dist/noop.d.ts +1 -1
- package/dist/noop.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
-
};
|
|
12
7
|
var __export = (target, all) => {
|
|
13
8
|
for (var name in all)
|
|
14
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -21,137 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
16
|
}
|
|
22
17
|
return to;
|
|
23
18
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
20
|
|
|
34
|
-
// node_modules/ms/index.js
|
|
35
|
-
var require_ms = __commonJS({
|
|
36
|
-
"node_modules/ms/index.js"(exports, module2) {
|
|
37
|
-
"use strict";
|
|
38
|
-
var s = 1e3;
|
|
39
|
-
var m = s * 60;
|
|
40
|
-
var h = m * 60;
|
|
41
|
-
var d = h * 24;
|
|
42
|
-
var w = d * 7;
|
|
43
|
-
var y = d * 365.25;
|
|
44
|
-
module2.exports = function(val, options) {
|
|
45
|
-
options = options || {};
|
|
46
|
-
var type = typeof val;
|
|
47
|
-
if (type === "string" && val.length > 0) {
|
|
48
|
-
return parse(val);
|
|
49
|
-
} else if (type === "number" && isFinite(val)) {
|
|
50
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
51
|
-
}
|
|
52
|
-
throw new Error(
|
|
53
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
function parse(str) {
|
|
57
|
-
str = String(str);
|
|
58
|
-
if (str.length > 100) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
62
|
-
str
|
|
63
|
-
);
|
|
64
|
-
if (!match) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
var n = parseFloat(match[1]);
|
|
68
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
69
|
-
switch (type) {
|
|
70
|
-
case "years":
|
|
71
|
-
case "year":
|
|
72
|
-
case "yrs":
|
|
73
|
-
case "yr":
|
|
74
|
-
case "y":
|
|
75
|
-
return n * y;
|
|
76
|
-
case "weeks":
|
|
77
|
-
case "week":
|
|
78
|
-
case "w":
|
|
79
|
-
return n * w;
|
|
80
|
-
case "days":
|
|
81
|
-
case "day":
|
|
82
|
-
case "d":
|
|
83
|
-
return n * d;
|
|
84
|
-
case "hours":
|
|
85
|
-
case "hour":
|
|
86
|
-
case "hrs":
|
|
87
|
-
case "hr":
|
|
88
|
-
case "h":
|
|
89
|
-
return n * h;
|
|
90
|
-
case "minutes":
|
|
91
|
-
case "minute":
|
|
92
|
-
case "mins":
|
|
93
|
-
case "min":
|
|
94
|
-
case "m":
|
|
95
|
-
return n * m;
|
|
96
|
-
case "seconds":
|
|
97
|
-
case "second":
|
|
98
|
-
case "secs":
|
|
99
|
-
case "sec":
|
|
100
|
-
case "s":
|
|
101
|
-
return n * s;
|
|
102
|
-
case "milliseconds":
|
|
103
|
-
case "millisecond":
|
|
104
|
-
case "msecs":
|
|
105
|
-
case "msec":
|
|
106
|
-
case "ms":
|
|
107
|
-
return n;
|
|
108
|
-
default:
|
|
109
|
-
return void 0;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
__name(parse, "parse");
|
|
113
|
-
function fmtShort(ms) {
|
|
114
|
-
var msAbs = Math.abs(ms);
|
|
115
|
-
if (msAbs >= d) {
|
|
116
|
-
return Math.round(ms / d) + "d";
|
|
117
|
-
}
|
|
118
|
-
if (msAbs >= h) {
|
|
119
|
-
return Math.round(ms / h) + "h";
|
|
120
|
-
}
|
|
121
|
-
if (msAbs >= m) {
|
|
122
|
-
return Math.round(ms / m) + "m";
|
|
123
|
-
}
|
|
124
|
-
if (msAbs >= s) {
|
|
125
|
-
return Math.round(ms / s) + "s";
|
|
126
|
-
}
|
|
127
|
-
return ms + "ms";
|
|
128
|
-
}
|
|
129
|
-
__name(fmtShort, "fmtShort");
|
|
130
|
-
function fmtLong(ms) {
|
|
131
|
-
var msAbs = Math.abs(ms);
|
|
132
|
-
if (msAbs >= d) {
|
|
133
|
-
return plural(ms, msAbs, d, "day");
|
|
134
|
-
}
|
|
135
|
-
if (msAbs >= h) {
|
|
136
|
-
return plural(ms, msAbs, h, "hour");
|
|
137
|
-
}
|
|
138
|
-
if (msAbs >= m) {
|
|
139
|
-
return plural(ms, msAbs, m, "minute");
|
|
140
|
-
}
|
|
141
|
-
if (msAbs >= s) {
|
|
142
|
-
return plural(ms, msAbs, s, "second");
|
|
143
|
-
}
|
|
144
|
-
return ms + " ms";
|
|
145
|
-
}
|
|
146
|
-
__name(fmtLong, "fmtLong");
|
|
147
|
-
function plural(ms, msAbs, n, name) {
|
|
148
|
-
var isPlural = msAbs >= n * 1.5;
|
|
149
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
150
|
-
}
|
|
151
|
-
__name(plural, "plural");
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
21
|
// src/cloudflare/index.ts
|
|
156
22
|
var index_exports = {};
|
|
157
23
|
__export(index_exports, {
|
|
@@ -159,7 +25,123 @@ __export(index_exports, {
|
|
|
159
25
|
default: () => index_default
|
|
160
26
|
});
|
|
161
27
|
module.exports = __toCommonJS(index_exports);
|
|
162
|
-
|
|
28
|
+
|
|
29
|
+
// src/ms.ts
|
|
30
|
+
var s = 1e3;
|
|
31
|
+
var m = s * 60;
|
|
32
|
+
var h = m * 60;
|
|
33
|
+
var d = h * 24;
|
|
34
|
+
var w = d * 7;
|
|
35
|
+
var y = d * 365.25;
|
|
36
|
+
function ms_default(val, options = {}) {
|
|
37
|
+
options = options || {};
|
|
38
|
+
const type = typeof val;
|
|
39
|
+
if (type === "string" && val.length > 0) {
|
|
40
|
+
return parse(val);
|
|
41
|
+
} else if (type === "number" && isFinite(val)) {
|
|
42
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
43
|
+
}
|
|
44
|
+
throw new Error(
|
|
45
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
__name(ms_default, "default");
|
|
49
|
+
function parse(str) {
|
|
50
|
+
str = String(str);
|
|
51
|
+
if (str.length > 100) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
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(
|
|
55
|
+
str
|
|
56
|
+
);
|
|
57
|
+
if (!match) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const n = parseFloat(match[1]);
|
|
61
|
+
const type = (match[2] || "ms").toLowerCase();
|
|
62
|
+
switch (type) {
|
|
63
|
+
case "years":
|
|
64
|
+
case "year":
|
|
65
|
+
case "yrs":
|
|
66
|
+
case "yr":
|
|
67
|
+
case "y":
|
|
68
|
+
return n * y;
|
|
69
|
+
case "weeks":
|
|
70
|
+
case "week":
|
|
71
|
+
case "w":
|
|
72
|
+
return n * w;
|
|
73
|
+
case "days":
|
|
74
|
+
case "day":
|
|
75
|
+
case "d":
|
|
76
|
+
return n * d;
|
|
77
|
+
case "hours":
|
|
78
|
+
case "hour":
|
|
79
|
+
case "hrs":
|
|
80
|
+
case "hr":
|
|
81
|
+
case "h":
|
|
82
|
+
return n * h;
|
|
83
|
+
case "minutes":
|
|
84
|
+
case "minute":
|
|
85
|
+
case "mins":
|
|
86
|
+
case "min":
|
|
87
|
+
case "m":
|
|
88
|
+
return n * m;
|
|
89
|
+
case "seconds":
|
|
90
|
+
case "second":
|
|
91
|
+
case "secs":
|
|
92
|
+
case "sec":
|
|
93
|
+
case "s":
|
|
94
|
+
return n * s;
|
|
95
|
+
case "milliseconds":
|
|
96
|
+
case "millisecond":
|
|
97
|
+
case "msecs":
|
|
98
|
+
case "msec":
|
|
99
|
+
case "ms":
|
|
100
|
+
return n;
|
|
101
|
+
default:
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
__name(parse, "parse");
|
|
106
|
+
function fmtShort(ms) {
|
|
107
|
+
const msAbs = Math.abs(ms);
|
|
108
|
+
if (msAbs >= d) {
|
|
109
|
+
return Math.round(ms / d) + "d";
|
|
110
|
+
}
|
|
111
|
+
if (msAbs >= h) {
|
|
112
|
+
return Math.round(ms / h) + "h";
|
|
113
|
+
}
|
|
114
|
+
if (msAbs >= m) {
|
|
115
|
+
return Math.round(ms / m) + "m";
|
|
116
|
+
}
|
|
117
|
+
if (msAbs >= s) {
|
|
118
|
+
return Math.round(ms / s) + "s";
|
|
119
|
+
}
|
|
120
|
+
return ms + "ms";
|
|
121
|
+
}
|
|
122
|
+
__name(fmtShort, "fmtShort");
|
|
123
|
+
function fmtLong(ms) {
|
|
124
|
+
const msAbs = Math.abs(ms);
|
|
125
|
+
if (msAbs >= d) {
|
|
126
|
+
return plural(ms, msAbs, d, "day");
|
|
127
|
+
}
|
|
128
|
+
if (msAbs >= h) {
|
|
129
|
+
return plural(ms, msAbs, h, "hour");
|
|
130
|
+
}
|
|
131
|
+
if (msAbs >= m) {
|
|
132
|
+
return plural(ms, msAbs, m, "minute");
|
|
133
|
+
}
|
|
134
|
+
if (msAbs >= s) {
|
|
135
|
+
return plural(ms, msAbs, s, "second");
|
|
136
|
+
}
|
|
137
|
+
return ms + " ms";
|
|
138
|
+
}
|
|
139
|
+
__name(fmtLong, "fmtLong");
|
|
140
|
+
function plural(ms, msAbs, n, name) {
|
|
141
|
+
const isPlural = msAbs >= n * 1.5;
|
|
142
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
143
|
+
}
|
|
144
|
+
__name(plural, "plural");
|
|
163
145
|
|
|
164
146
|
// src/common.ts
|
|
165
147
|
function coerce(val) {
|
|
@@ -214,10 +196,8 @@ var colors = [
|
|
|
214
196
|
"#666666"
|
|
215
197
|
];
|
|
216
198
|
var index_default = createDebug;
|
|
217
|
-
function isEnabled(namespace,
|
|
218
|
-
|
|
219
|
-
const DEBUG = typeof globalThis !== "undefined" && globalThis.DEBUG || typeof process !== "undefined" && process.env?.DEBUG;
|
|
220
|
-
if (DEBUG === "*") return true;
|
|
199
|
+
function isEnabled(namespace, env) {
|
|
200
|
+
const DEBUG = env?.DEBUG || typeof globalThis !== "undefined" && globalThis.DEBUG || typeof process !== "undefined" && process.env?.DEBUG;
|
|
221
201
|
if (namespace === "DEV") {
|
|
222
202
|
if (!DEBUG) {
|
|
223
203
|
return true;
|
|
@@ -225,6 +205,7 @@ function isEnabled(namespace, forcedEnabled) {
|
|
|
225
205
|
return false;
|
|
226
206
|
}
|
|
227
207
|
if (!DEBUG) return false;
|
|
208
|
+
if (DEBUG === "*") return true;
|
|
228
209
|
const envVars = createRegexFromEnvVar(DEBUG);
|
|
229
210
|
return envVars.some((regex) => regex.test(namespace));
|
|
230
211
|
}
|
|
@@ -241,9 +222,9 @@ function createFormatters() {
|
|
|
241
222
|
};
|
|
242
223
|
}
|
|
243
224
|
__name(createFormatters, "createFormatters");
|
|
244
|
-
function logger(namespace, args, { prevTime, color },
|
|
225
|
+
function logger(namespace, args, { prevTime, color }, env) {
|
|
245
226
|
args = args || [];
|
|
246
|
-
if (!isEnabled(namespace,
|
|
227
|
+
if (!isEnabled(namespace, env)) return;
|
|
247
228
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
248
229
|
const diff = curr - (prevTime || curr);
|
|
249
230
|
prevTime = curr;
|
|
@@ -279,30 +260,36 @@ function shouldUseColors() {
|
|
|
279
260
|
}
|
|
280
261
|
__name(shouldUseColors, "shouldUseColors");
|
|
281
262
|
function formatArgs({ diff, namespace }, args) {
|
|
282
|
-
args[0] = namespace + " " + args[0] + " +" + (
|
|
263
|
+
args[0] = namespace + " " + args[0] + " +" + ms_default(diff, {});
|
|
283
264
|
return args;
|
|
284
265
|
}
|
|
285
266
|
__name(formatArgs, "formatArgs");
|
|
286
|
-
function createDebug(
|
|
287
|
-
if (
|
|
267
|
+
function createDebug(namespaceOrEnabled, env) {
|
|
268
|
+
if (typeof namespaceOrEnabled === "boolean") {
|
|
269
|
+
if (namespaceOrEnabled === false) return noop;
|
|
270
|
+
return createDebug("DEV", { DEBUG: "*" });
|
|
271
|
+
}
|
|
288
272
|
const prevTime = Number(/* @__PURE__ */ new Date());
|
|
289
273
|
const color = selectColor(
|
|
290
|
-
typeof
|
|
274
|
+
typeof namespaceOrEnabled === "string" ? namespaceOrEnabled : generateRandomString(10),
|
|
291
275
|
colors
|
|
292
276
|
);
|
|
293
|
-
const
|
|
294
|
-
|
|
277
|
+
const actualNamespace = typeof namespaceOrEnabled === "string" ? namespaceOrEnabled : "DEV";
|
|
278
|
+
let envObj;
|
|
279
|
+
if (typeof env === "object") {
|
|
280
|
+
envObj = env;
|
|
281
|
+
}
|
|
295
282
|
const debug = /* @__PURE__ */ __name(function(...args) {
|
|
296
283
|
return logger(
|
|
297
284
|
actualNamespace,
|
|
298
285
|
args,
|
|
299
286
|
{ prevTime, color },
|
|
300
|
-
|
|
287
|
+
envObj
|
|
301
288
|
);
|
|
302
289
|
}, "debug");
|
|
303
290
|
debug.extend = function(extension) {
|
|
304
291
|
const extendedNamespace = actualNamespace + ":" + extension;
|
|
305
|
-
return createDebug(extendedNamespace);
|
|
292
|
+
return createDebug(extendedNamespace, envObj);
|
|
306
293
|
};
|
|
307
294
|
return debug;
|
|
308
295
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../
|
|
4
|
-
"sourcesContent": ["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar 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\nmodule.exports = function (val, options) {\n options = options || {};\n var 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 var 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 var n = parseFloat(match[1]);\n var 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 var 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 var 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 var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n", "import humanize from 'ms'\nimport {\n generateRandomString,\n coerce,\n selectColor,\n createRegexFromEnvVar\n} from '../common.js'\nimport { noop } from '../noop.js'\n\n// Cloudflare Workers have a limited set of Web APIs\n// No localStorage, document, or navigator\nconst log = console.log || (() => {})\n\n// Simple color palette for Cloudflare Workers (no DOM-based colors)\nconst colors = [\n '#0066CC', '#CC0066', '#66CC00', '#CC6600', '#6600CC', '#00CC66',\n '#CC0000', '#0000CC', '#00CCCC', '#CCCC00', '#CC00CC', '#666666'\n]\n\nexport { createDebug }\nexport default createDebug\n\n/**\n * Check if the given namespace is enabled in Cloudflare Workers.\n * Since there's no localStorage, we check environment variables or global DEBUG.\n * `namespace` is the name that is passed into debug.\n * `forcedEnabled` is a boolean that forces logging when true.\n */\nfunction isEnabled (namespace: string, forcedEnabled?: boolean): boolean {\n // If explicitly forced to be enabled via boolean true\n if (forcedEnabled === true) return true\n\n // In Cloudflare Workers, check global DEBUG variable or environment\n const DEBUG = (typeof globalThis !== 'undefined' && (globalThis as any).DEBUG) ||\n (typeof process !== 'undefined' && process.env?.DEBUG)\n\n // Check for wildcard\n if (DEBUG === '*') return true\n\n // if we were not called with a namespace\n if (namespace === 'DEV') {\n // We want to log iff there is no DEBUG variable.\n if (!DEBUG) {\n return true\n }\n return false\n }\n\n // No DEBUG variable set\n if (!DEBUG) return false\n\n const envVars = createRegexFromEnvVar(DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Map %j to `JSON.stringify()`, since Cloudflare Workers don't have Web Inspectors.\n */\nfunction createFormatters () {\n return {\n j: function (v: any) {\n try {\n return JSON.stringify(v)\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + String(error)\n }\n }\n }\n}\n\nfunction logger (\n namespace: string,\n args: any[],\n { prevTime, color },\n forcedEnabled?: boolean\n) {\n args = args || []\n if (!isEnabled(namespace, forcedEnabled)) return\n\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()\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(globalThis, 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 Cloudflare-specific formatting (no colors in Workers typically)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\nfunction shouldUseColors (): boolean {\n // Cloudflare Workers typically don't support colors in console output\n // But we can detect if we're in a development environment\n return false\n}\n\n/**\n * Format log arguments for Cloudflare Workers (no color support typically).\n */\nfunction formatArgs ({ diff, namespace }: {\n diff: number,\n color: number,\n namespace: string,\n useColors: boolean\n}, args) {\n args[0] = namespace + ' ' + args[0] + ' +' + humanize(diff, {})\n return args\n}\n\nexport type CloudflareDebugger = {\n (...args: any[]): void;\n extend: (namespace: string) => CloudflareDebugger;\n}\n\nfunction createDebug (namespace?: string | boolean): CloudflareDebugger {\n if (namespace === false) return noop\n const prevTime = Number(new Date())\n const color = selectColor(\n typeof namespace === 'string' ? namespace : generateRandomString(10),\n colors\n )\n\n // Determine if this is a boolean true passed as the namespace\n const forcedEnabled = namespace === true\n const actualNamespace = typeof namespace === 'string' ? namespace : 'DEV'\n\n const debug = function (...args: any[]) {\n return logger(\n actualNamespace,\n args,\n { prevTime, color },\n forcedEnabled\n )\n }\n\n debug.extend = function (extension: string): CloudflareDebugger {\n const extendedNamespace = actualNamespace + ':' + extension\n return createDebug(extendedNamespace)\n }\n\n return debug as CloudflareDebugger\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\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", "import { type Debugger } from './browser/index.js'\n\nexport const noop:Debugger = function (_args:any[]) {}\nnoop.extend = function (_namespace:string) { return noop }\n\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../src/cloudflare/index.ts", "../../src/ms.ts", "../../src/common.ts", "../../src/noop.ts"],
|
|
4
|
+
"sourcesContent": ["import humanize from '../ms.js'\nimport {\n generateRandomString,\n coerce,\n selectColor,\n createRegexFromEnvVar,\n type Debugger\n} from '../common.js'\nimport { noop } from '../noop.js'\n\n// Cloudflare Workers have a limited set of Web APIs\n// No localStorage, document, or navigator\nconst log = console.log || (() => {})\n\n// Simple color palette for Cloudflare Workers (no DOM-based colors)\nconst colors = [\n '#0066CC', '#CC0066', '#66CC00', '#CC6600', '#6600CC', '#00CC66',\n '#CC0000', '#0000CC', '#00CCCC', '#CCCC00', '#CC00CC', '#666666'\n]\n\nexport { createDebug }\nexport default createDebug\n\n/**\n * Check if the given namespace is enabled in Cloudflare Workers.\n * Since there's no localStorage, we check environment variables or global DEBUG.\n * `namespace` is the name that is passed into debug.\n * `env` is an optional environment object that can contain DEBUG setting.\n */\nfunction isEnabled (namespace:string, env?:Record<string, string>):boolean {\n // Determine the DEBUG value from env parameter, global, or process.env\n const DEBUG = env?.DEBUG ||\n (typeof globalThis !== 'undefined' && (globalThis as any).DEBUG) ||\n (typeof process !== 'undefined' && process.env?.DEBUG)\n\n // If no namespace (DEV mode), check if there's no DEBUG variable\n if (namespace === 'DEV') {\n // We want to log iff there is no DEBUG variable.\n if (!DEBUG) {\n return true\n }\n return false\n }\n\n // No DEBUG variable set\n if (!DEBUG) return false\n\n // Check for wildcard\n if (DEBUG === '*') return true\n\n // Check namespace vs DEBUG env var\n const envVars = createRegexFromEnvVar(DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Map %j to `JSON.stringify()`, since Cloudflare Workers don't\n * have Web Inspectors.\n */\nfunction createFormatters () {\n return {\n j: function (v:any) {\n try {\n return JSON.stringify(v)\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + String(error)\n }\n }\n }\n}\n\nfunction logger (\n namespace:string,\n args:any[],\n { prevTime, color },\n env?:Record<string, string>\n) {\n args = args || []\n if (!isEnabled(namespace, env)) return\n\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()\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(globalThis, 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 Cloudflare-specific formatting (no colors in Workers typically)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\nfunction shouldUseColors ():boolean {\n // Cloudflare Workers typically don't support colors in console output\n // But we can detect if we're in a development environment\n return false\n}\n\n/**\n * Format log arguments for Cloudflare Workers (no color support typically).\n * Mutates the given args.\n */\nfunction formatArgs ({ diff, namespace }:{\n diff:number,\n color:number,\n namespace:string,\n useColors:boolean\n}, args:string[]) {\n args[0] = namespace + ' ' + args[0] + ' +' + humanize(diff, {})\n return args\n}\n\nfunction createDebug (namespace?:string, env?:Record<string, string>):Debugger;\nfunction createDebug (enabled:boolean):Debugger;\nfunction createDebug (\n namespaceOrEnabled?:string|boolean,\n env?:Record<string, string>\n):Debugger {\n // Handle the case where first parameter is a boolean\n if (typeof namespaceOrEnabled === 'boolean') {\n if (namespaceOrEnabled === false) return noop\n // If namespaceOrEnabled is true, use DEV mode with forced logging\n return createDebug('DEV', { DEBUG: '*' })\n }\n\n const prevTime = Number(new Date())\n const color = selectColor(\n typeof namespaceOrEnabled === 'string' ?\n namespaceOrEnabled :\n generateRandomString(10),\n colors\n )\n\n const actualNamespace = typeof namespaceOrEnabled === 'string' ?\n namespaceOrEnabled :\n 'DEV'\n\n // Handle environment parameter\n let envObj:Record<string, string>|undefined\n if (typeof env === 'object') {\n envObj = env\n }\n\n const debug = function (...args:any[]) {\n return logger(\n actualNamespace,\n args,\n { prevTime, color },\n envObj\n )\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = actualNamespace + ':' + extension\n return createDebug(extendedNamespace, envObj)\n }\n\n return debug\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", "/**\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", "import { type Debugger } from './common.js'\n\nexport const noop:Debugger = function (_args:any[]) {}\nnoop.extend = function (_namespace:string) { return noop }\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIA,IAAM,IAAI;AACV,IAAM,IAAI,IAAI;AACd,IAAM,IAAI,IAAI;AACd,IAAM,IAAI,IAAI;AACd,IAAM,IAAI,IAAI;AACd,IAAM,IAAI,IAAI;AAgBC,SAAR,WAAkB,KAAK,UAA4B,CAAC,GAAG;AAC1D,YAAU,WAAW,CAAC;AACtB,QAAM,OAAO,OAAO;AACpB,MAAI,SAAS,YAAY,IAAI,SAAS,GAAG;AACrC,WAAO,MAAM,GAAG;AAAA,EACpB,WAAW,SAAS,YAAY,SAAS,GAAG,GAAG;AAC3C,WAAO,QAAQ,OAAO,QAAQ,GAAG,IAAI,SAAS,GAAG;AAAA,EACrD;AACA,QAAM,IAAI;AAAA,IACN,0DACF,KAAK,UAAU,G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,qBACA,qBAAqB,EAAE;AAAA,IAC3B;AAAA,EACJ;AAEA,QAAM,kBAAkB,OAAO,uBAAuB,WAClD,qBACA;AAGJ,MAAI;AACJ,MAAI,OAAO,QAAQ,UAAU;AACzB,aAAS;AAAA,EACb;AAEA,QAAM,QAAQ,mCAAa,MAAY;AACnC,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA,EAAE,UAAU,MAAM;AAAA,MAClB;AAAA,IACJ;AAAA,EACJ,GAPc;AASd,QAAM,SAAS,SAAU,WAA2B;AAChD,UAAM,oBAAoB,kBAAkB,MAAM;AAClD,WAAO,YAAY,mBAAmB,MAAM;AAAA,EAChD;AAEA,SAAO;AACX;AA5CS;",
|
|
6
|
+
"names": ["colors"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { type Debugger } from '../common.js';
|
|
1
2
|
export { createDebug };
|
|
2
3
|
export default createDebug;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
extend: (namespace: string) => CloudflareDebugger;
|
|
6
|
-
};
|
|
7
|
-
declare function createDebug(namespace?: string | boolean): CloudflareDebugger;
|
|
4
|
+
declare function createDebug(namespace?: string, env?: Record<string, string>): Debugger;
|
|
5
|
+
declare function createDebug(enabled: boolean): Debugger;
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,KAAK,QAAQ,EAChB,MAAM,cAAc,CAAA;AAarB,OAAO,EAAE,WAAW,EAAE,CAAA;AACtB,eAAe,WAAW,CAAA;AA6H1B,iBAAS,WAAW,CAAE,SAAS,CAAC,EAAC,MAAM,EAAE,GAAG,CAAC,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAE,QAAQ,CAAC;AAC/E,iBAAS,WAAW,CAAE,OAAO,EAAC,OAAO,GAAE,QAAQ,CAAC"}
|