@puq/debug 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,9 +6,7 @@
6
6
 
7
7
  ## Summary
8
8
 
9
- The library privides 3 functions, `start`, `end`, and `debug`. These function only work when the `process.env.DEBUG_MODE` is `true`.
10
-
11
- `start` function is for indicating context of the debug such as `operationName` and the `end` function is for indicating the closing of the context.
9
+ The debug logger utilize the `console.log` and `console.table` (for objects). The function only runs if the `process.env.DEBUG_MODE` is `true`.
12
10
 
13
11
  ## Install
14
12
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  export * from './lib/debug.js';
2
- export * from './lib/end.js';
3
2
  export * from './lib/is-debug-mode.js';
4
- export * from './lib/start.js';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  // @index(['./**/*.ts', '!./**/*.{spec,test}.ts'], f => `export * from '${f.path}.js'`)
2
2
  export * from './lib/debug.js';
3
- export * from './lib/end.js';
4
3
  export * from './lib/is-debug-mode.js';
5
- export * from './lib/start.js';
6
4
 
7
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/debug.js';\nexport * from './lib/end.js';\nexport * from './lib/is-debug-mode.js';\nexport * from './lib/start.js';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,uFAAuF;AACvF,cAAc,iBAAiB;AAC/B,cAAc,eAAe;AAC7B,cAAc,yBAAyB;AACvC,cAAc,iBAAiB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/debug.js';\nexport * from './lib/is-debug-mode.js';\n"],"names":[],"rangeMappings":";;","mappings":"AAAA,uFAAuF;AACvF,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/lib/debug.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAW7C"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/lib/debug.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,CAa7C"}
package/dist/lib/debug.js CHANGED
@@ -7,9 +7,11 @@ import { isDebugMode } from './is-debug-mode.js';
7
7
  if (message.every((e)=>{
8
8
  return typeof e != 'object';
9
9
  })) {
10
- console.log(...message);
10
+ console.log('[ DEBUG ', ...message, ' ]');
11
11
  } else {
12
+ console.log('[ DEBUG ');
12
13
  console.table(message);
14
+ console.log(' ]');
13
15
  }
14
16
  }
15
17
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/debug.ts"],"sourcesContent":["import { isDebugMode } from './is-debug-mode.js';\n\n/**\n * Print a debug message if DEBUG_MODE is active\n * @returns\n */\nexport function debug(...message: any[]): void {\n if (!isDebugMode()) return;\n if (\n message.every((e) => {\n return typeof e != 'object';\n })\n ) {\n console.log(...message);\n } else {\n console.table(message);\n }\n}\n"],"names":["isDebugMode","debug","message","every","e","console","log","table"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;CAGC,GACD,OAAO,SAASC,MAAM,GAAGC,OAAc;IACrC,IAAI,CAACF,eAAe;IACpB,IACEE,QAAQC,KAAK,CAAC,CAACC;QACb,OAAO,OAAOA,KAAK;IACrB,IACA;QACAC,QAAQC,GAAG,IAAIJ;IACjB,OAAO;QACLG,QAAQE,KAAK,CAACL;IAChB;AACF"}
1
+ {"version":3,"sources":["../../src/lib/debug.ts"],"sourcesContent":["import { isDebugMode } from './is-debug-mode.js';\n\n/**\n * Print a debug message if DEBUG_MODE is active\n * @returns\n */\nexport function debug(...message: any[]): void {\n if (!isDebugMode()) return;\n if (\n message.every((e) => {\n return typeof e != 'object';\n })\n ) {\n console.log('[ DEBUG ', ...message, ' ]');\n } else {\n console.log('[ DEBUG ');\n console.table(message);\n console.log(' ]');\n }\n}\n"],"names":["isDebugMode","debug","message","every","e","console","log","table"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;CAGC,GACD,OAAO,SAASC,MAAM,GAAGC,OAAc;IACrC,IAAI,CAACF,eAAe;IACpB,IACEE,QAAQC,KAAK,CAAC,CAACC;QACb,OAAO,OAAOA,KAAK;IACrB,IACA;QACAC,QAAQC,GAAG,CAAC,gBAAgBJ,SAAS;IACvC,OAAO;QACLG,QAAQC,GAAG,CAAC;QACZD,QAAQE,KAAK,CAACL;QACdG,QAAQC,GAAG,CAAC;IACd;AACF"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@puq/debug",
3
3
  "license": "MIT",
4
- "version": "0.1.0",
4
+ "version": "0.3.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "tag": "latest"
8
8
  },
9
- "description": "debug",
9
+ "description": "The debug logger utilize the `console.log` and `console.table` (for objects). The function only runs if the `process.env.DEBUG_MODE` is `true`.",
10
10
  "author": {
11
11
  "email": "robert.brightline@gmail.com",
12
12
  "name": "Robert Brightline",
package/dist/lib/end.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Print a closing indicator for the debugger if DEBUG_MODE is active
3
- * @returns
4
- */
5
- export declare function end(): void;
6
- //# sourceMappingURL=end.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"end.d.ts","sourceRoot":"","sources":["../../src/lib/end.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,GAAG,SAKlB"}
package/dist/lib/end.js DELETED
@@ -1,12 +0,0 @@
1
- import { isDebugMode } from './is-debug-mode.js';
2
- /**
3
- * Print a closing indicator for the debugger if DEBUG_MODE is active
4
- * @returns
5
- */ export function end() {
6
- if (!isDebugMode()) return;
7
- console.log(`----------------------------End`);
8
- console.log(' ');
9
- console.log(' ');
10
- }
11
-
12
- //# sourceMappingURL=end.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/end.ts"],"sourcesContent":["import { isDebugMode } from './is-debug-mode.js';\r\n\r\n/**\r\n * Print a closing indicator for the debugger if DEBUG_MODE is active\r\n * @returns\r\n */\r\nexport function end() {\r\n if (!isDebugMode()) return;\r\n console.log(`----------------------------End`);\r\n console.log(' ');\r\n console.log(' ');\r\n}\r\n"],"names":["isDebugMode","end","console","log"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;CAGC,GACD,OAAO,SAASC;IACd,IAAI,CAACD,eAAe;IACpBE,QAAQC,GAAG,CAAC,CAAC,+BAA+B,CAAC;IAC7CD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd"}
@@ -1,7 +0,0 @@
1
- /**
2
- *
3
- * Print a opening indicator for the debugger if DEBUG_MODE is active
4
- * @param context Debug context
5
- */
6
- export declare function start(context?: string): void;
7
- //# sourceMappingURL=start.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/lib/start.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,OAAO,SAAU,QAGtC"}
package/dist/lib/start.js DELETED
@@ -1,11 +0,0 @@
1
- import { isDebugMode } from './is-debug-mode.js';
2
- /**
3
- *
4
- * Print a opening indicator for the debugger if DEBUG_MODE is active
5
- * @param context Debug context
6
- */ export function start(context = 'Debug') {
7
- if (!isDebugMode()) return;
8
- console.log(`[ ${context} ] ----------------------------Start`);
9
- }
10
-
11
- //# sourceMappingURL=start.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/start.ts"],"sourcesContent":["import { isDebugMode } from './is-debug-mode.js';\r\n\r\n/**\r\n *\r\n * Print a opening indicator for the debugger if DEBUG_MODE is active\r\n * @param context Debug context\r\n */\r\nexport function start(context = 'Debug') {\r\n if (!isDebugMode()) return;\r\n console.log(`[ ${context} ] ----------------------------Start`);\r\n}\r\n"],"names":["isDebugMode","start","context","console","log"],"rangeMappings":";;;;;;;;","mappings":"AAAA,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;;CAIC,GACD,OAAO,SAASC,MAAMC,UAAU,OAAO;IACrC,IAAI,CAACF,eAAe;IACpBG,QAAQC,GAAG,CAAC,CAAC,EAAE,EAAEF,QAAQ,oCAAoC,CAAC;AAChE"}