From 1c238c0f08df047dc8dc11dd069519cc4c68b7ee Mon Sep 17 00:00:00 2001 From: Kirill Loskutov Date: Sun, 22 Oct 2023 22:05:05 +0200 Subject: [PATCH] style: improve export for debug (#497) --- src/platform.deno.ts | 10 +++++----- src/platform.node.ts | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/platform.deno.ts b/src/platform.deno.ts index 0d2feb6b..b8f37474 100644 --- a/src/platform.deno.ts +++ b/src/platform.deno.ts @@ -2,17 +2,17 @@ export const isDeno = typeof Deno !== "undefined"; // === Export debug -import d from "https://cdn.skypack.dev/debug@4.3.4"; -export { d as debug }; +import debug from "https://cdn.skypack.dev/debug@4.3.4"; +export { debug }; const DEBUG = "DEBUG"; if (isDeno) { - d.useColors = () => !Deno.noColor; + debug.useColors = () => !Deno.noColor; const env = { name: "env", variable: DEBUG } as const; const res = await Deno.permissions.query(env); let namespace: string | undefined = undefined; if (res.state === "granted") namespace = Deno.env.get(DEBUG); - if (namespace) d.enable(namespace); - else d.disable(); + if (namespace) debug.enable(namespace); + else debug.disable(); } // === Export system-specific operations diff --git a/src/platform.node.ts b/src/platform.node.ts index 622d46fc..49191a4d 100644 --- a/src/platform.node.ts +++ b/src/platform.node.ts @@ -4,8 +4,7 @@ import { Agent as HttpsAgent } from "https"; import { Readable } from "stream"; // === Export debug -import { debug as d } from "debug"; -export { d as debug }; +export { debug } from "debug"; // === Export system-specific operations // Turn an AsyncIterable into a stream