Comparing version 0.0.8 to 0.0.9
/// <reference types="node" /> | ||
import { InspectOptions } from 'util'; | ||
export interface Debug { | ||
(namespace: string): Debugger; | ||
(namespace?: string, enable?: boolean): Debugger; | ||
enable: (namespaces?: string) => void; | ||
@@ -42,3 +42,3 @@ disable: () => void; | ||
*/ | ||
export declare function Debug(namespace?: string): Debugger; | ||
export declare function Debug(namespace?: string, enable?: boolean): Debugger; | ||
export declare namespace Debug { | ||
@@ -45,0 +45,0 @@ var formatArgs: (this: any, fun: any, timer: string, args: any[]) => void; |
@@ -13,3 +13,7 @@ "use strict"; | ||
// tslint:disable-next-line:function-name | ||
function Debug(namespace) { | ||
function Debug(namespace, enable) { | ||
// tslint:disable-next-line:no-parameter-reassignment | ||
namespace = namespace || 'debug'; | ||
if (enable) | ||
Debug.enable(namespace); | ||
let prevTime; | ||
@@ -16,0 +20,0 @@ function debug(...args) { |
{ | ||
"name": "exer", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Utils in TypeScript, Debug, NanoTimer ...", | ||
@@ -5,0 +5,0 @@ "author": "kbajalc@gmail.com", |
Sorry, the diff of this file is not supported yet
66374
951