Skip to content

Commit ebb6c53

Browse files
committed
fix: don't stringify DebugFn arguments
1 parent 2b01e06 commit ebb6c53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grammyjs/debug",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": [

src/mod.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ export function createDebug(namespace: string): DebugFn {
5454

5555
const debugfn = (...data: unknown[]) => {
5656
if (!debugfn.enabled) return;
57-
const start = data.length ? data.shift() : "";
57+
const format = typeof data[0] === "string" ? " " + data.shift() : "";
5858
if (useAnsi) {
59-
console.debug(`${ansiNamespace} ${start}`, ...data);
59+
console.debug(`${ansiNamespace}${format}`, ...data);
6060
} else {
6161
console.debug(
62-
`%c${namespace}%c ${start}`,
62+
`%c${namespace}%c${format}`,
6363
css,
6464
"color: inherit",
6565
...data,

0 commit comments

Comments
 (0)