@puq/debug 0.2.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 +1 -3
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/debug.d.ts.map +1 -1
- package/dist/lib/debug.js +3 -1
- package/dist/lib/debug.js.map +1 -1
- package/package.json +2 -2
- package/dist/lib/end.d.ts +0 -6
- package/dist/lib/end.d.ts.map +0 -1
- package/dist/lib/end.js +0 -12
- package/dist/lib/end.js.map +0 -1
- package/dist/lib/start.d.ts +0 -7
- package/dist/lib/start.d.ts.map +0 -1
- package/dist/lib/start.js +0 -11
- package/dist/lib/start.js.map +0 -1
package/README.md
CHANGED
@@ -6,9 +6,7 @@
|
|
6
6
|
|
7
7
|
## Summary
|
8
8
|
|
9
|
-
The
|
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
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,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
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/
|
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"}
|
package/dist/lib/debug.d.ts.map
CHANGED
@@ -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,
|
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
|
|
package/dist/lib/debug.js.map
CHANGED
@@ -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":"
|
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.
|
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
package/dist/lib/end.d.ts.map
DELETED
@@ -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
|
package/dist/lib/end.js.map
DELETED
@@ -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"}
|
package/dist/lib/start.d.ts
DELETED
package/dist/lib/start.d.ts.map
DELETED
@@ -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
|
package/dist/lib/start.js.map
DELETED
@@ -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"}
|