Skip to content

Commit

Permalink
Add miliseconds formatting back
Browse files Browse the repository at this point in the history
  • Loading branch information
rista404 committed May 28, 2020
1 parent 6ca6b69 commit 345a3c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions debug.ts
@@ -1,4 +1,5 @@
const { noColor, env } = Deno;
import { ms } from "https://raw.githubusercontent.com/denolib/ms/master/ms.ts";
import format from "./format.ts";
import { coerce, selectColor, regexpToNamespace } from "./utils.ts";

Expand Down Expand Up @@ -188,8 +189,9 @@ export function enable(namespaces: any) {

// Resets enabled and disable namespaces
names = [];
skips = [] // Splits on comma
; // Loops through the passed namespaces
skips = [];
// Splits on comma
// Loops through the passed namespaces
// And groups them in enabled and disabled lists
(typeof namespaces === "string" ? namespaces : "")
.split(/[\s,]+/)
Expand Down Expand Up @@ -230,7 +232,9 @@ function formatArgs(
.map((line: string) => `${prefix}${line}`)
.join("\n");

const lastArg = noColor ? `+${diff}` : `${colorCode}m+${diff}${"\u001B[0m"}`;
const lastArg = noColor
? `+${ms(diff)}`
: `${colorCode}m+${ms(diff)}${"\u001B[0m"}`;

return [...args, lastArg];
}
Expand Down

0 comments on commit 345a3c5

Please sign in to comment.