| import { a as Debugger, i as DebugOptions, n as enabled, o as Formatters, r as namespaces, s as InspectOptions, t as disable } from "./core.js"; | ||
| //#region src/browser.d.ts | ||
| declare function createDebug(namespace: string, options?: DebugOptions): Debugger; | ||
| /** | ||
| * Enables a debug mode by namespaces. This can include modes | ||
| * separated by a colon and wildcards. | ||
| */ | ||
| * Enables a debug mode by namespaces. This can include modes | ||
| * separated by a colon and wildcards. | ||
| */ | ||
| declare function enable(namespaces: string): void; | ||
| //#endregion | ||
| export { type DebugOptions, type Debugger, type Formatters, type InspectOptions, createDebug, disable, enable, enabled, namespaces }; |
+10
-11
| import { InspectOptions } from "node:util"; | ||
| //#region src/types.d.ts | ||
@@ -8,6 +7,6 @@ interface InspectOptions$1 extends InspectOptions { | ||
| /** | ||
| * Map of special "%n" handling functions, for the debug "format" argument. | ||
| * | ||
| * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". | ||
| */ | ||
| * Map of special "%n" handling functions, for the debug "format" argument. | ||
| * | ||
| * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". | ||
| */ | ||
| interface Formatters { | ||
@@ -36,14 +35,14 @@ [formatter: string]: (this: Debugger, v: any) => string; | ||
| /** | ||
| * Returns a string of the currently enabled debug namespaces. | ||
| */ | ||
| * Returns a string of the currently enabled debug namespaces. | ||
| */ | ||
| declare function namespaces(): string; | ||
| /** | ||
| * Disable debug output. | ||
| */ | ||
| * Disable debug output. | ||
| */ | ||
| declare function disable(): string; | ||
| /** | ||
| * Returns true if the given mode name is enabled, false otherwise. | ||
| */ | ||
| * Returns true if the given mode name is enabled, false otherwise. | ||
| */ | ||
| declare function enabled(name: string): boolean; | ||
| //#endregion | ||
| export { Debugger as a, DebugOptions as i, enabled as n, Formatters as o, namespaces as r, InspectOptions$1 as s, disable as t }; |
+3
-4
| import { a as Debugger, i as DebugOptions, n as enabled, o as Formatters, r as namespaces, s as InspectOptions, t as disable } from "./core.js"; | ||
| //#region src/node.d.ts | ||
| declare function createDebug(namespace: string, options?: DebugOptions): Debugger; | ||
| /** | ||
| * Enables a debug mode by namespaces. This can include modes | ||
| * separated by a colon and wildcards. | ||
| */ | ||
| * Enables a debug mode by namespaces. This can include modes | ||
| * separated by a colon and wildcards. | ||
| */ | ||
| declare function enable(namespaces: string): void; | ||
| //#endregion | ||
| export { type DebugOptions, type Debugger, type Formatters, type InspectOptions, createDebug, disable, enable, enabled, namespaces }; |
+11
-6
@@ -5,3 +5,8 @@ import { a as namespaces, i as enabled, n as disable, o as humanize, r as enable$1, s as selectColor, t as createDebug$1 } from "./core.js"; | ||
| //#region src/node.ts | ||
| const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [ | ||
| let env = {}; | ||
| try { | ||
| process.env.DEBUG; | ||
| env = process.env; | ||
| } catch (_unused) {} | ||
| const colors = process.stderr.getColorDepth && process.stderr.getColorDepth(env) > 2 ? [ | ||
| 20, | ||
@@ -91,5 +96,5 @@ 21, | ||
| ]; | ||
| const inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => { | ||
| const inspectOpts = Object.keys(env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => { | ||
| const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase()); | ||
| let value = process.env[key]; | ||
| let value = env[key]; | ||
| const lowerCase = typeof value === "string" && value.toLowerCase(); | ||
@@ -158,4 +163,4 @@ if (value === "null") value = null; | ||
| function save(namespaces) { | ||
| if (namespaces) process.env.DEBUG = namespaces; | ||
| else delete process.env.DEBUG; | ||
| if (namespaces) env.DEBUG = namespaces; | ||
| else delete env.DEBUG; | ||
| } | ||
@@ -170,4 +175,4 @@ /** | ||
| } | ||
| enable$1(process.env.DEBUG || ""); | ||
| enable$1(env.DEBUG || ""); | ||
| //#endregion | ||
| export { createDebug, disable, enable, enabled, namespaces }; |
+12
-12
| { | ||
| "name": "obug", | ||
| "type": "module", | ||
| "version": "2.1.3", | ||
| "version": "2.1.4", | ||
| "description": "A lightweight JavaScript debugging utility, forked from debug, featuring TypeScript and ESM support.", | ||
@@ -43,18 +43,18 @@ "author": "Kevin Deng <sxzz@sxzz.moe>", | ||
| "devDependencies": { | ||
| "@sxzz/eslint-config": "^8.1.0", | ||
| "@sxzz/eslint-config": "^8.2.1", | ||
| "@sxzz/prettier-config": "^2.3.1", | ||
| "@types/debug": "^4.1.13", | ||
| "@types/node": "^25.9.2", | ||
| "@typescript/native-preview": "7.0.0-dev.20260609.1", | ||
| "@vitest/browser-playwright": "^4.1.8", | ||
| "@vitest/coverage-v8": "^4.1.8", | ||
| "@types/node": "^26.1.1", | ||
| "@typescript/native-preview": "7.0.0-dev.20260707.2", | ||
| "@vitest/browser-playwright": "^4.1.10", | ||
| "@vitest/coverage-v8": "^4.1.10", | ||
| "bumpp": "^11.1.0", | ||
| "debug": "^4.4.3", | ||
| "eslint": "^10.4.1", | ||
| "playwright": "^1.60.0", | ||
| "prettier": "^3.8.4", | ||
| "tsdown": "^0.22.2", | ||
| "eslint": "^10.7.0", | ||
| "playwright": "^1.61.1", | ||
| "prettier": "^3.9.5", | ||
| "tsdown": "^0.22.9", | ||
| "typescript": "^6.0.3", | ||
| "vite": "^8.0.16", | ||
| "vitest": "^4.1.8" | ||
| "vite": "^8.1.5", | ||
| "vitest": "^4.1.10" | ||
| }, | ||
@@ -61,0 +61,0 @@ "prettier": "@sxzz/prettier-config", |
27203
0.22%547
0.92%4
-42.86%