@puq/debug 0.3.1 → 0.3.3
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/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/debug.js +3 -15
- package/dist/lib/debug.js.map +1 -1
- package/dist/lib/is-debug-mode.js +2 -2
- package/dist/lib/is-debug-mode.js.map +1 -1
- package/dist/package.json +86 -0
- package/package.json +7 -4
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/is-debug-mode.js';\n"],"names":[],"
|
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":[],"mappings":"AACA,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB"}
|
package/dist/lib/debug.js
CHANGED
@@ -1,18 +1,6 @@
|
|
1
|
-
import { isDebugMode } from './is-debug-mode.js';
|
2
|
-
|
3
|
-
|
4
|
-
* @returns
|
5
|
-
*/ export function debug(...message) {
|
6
|
-
if (!isDebugMode()) return;
|
7
|
-
if (message.every((e)=>{
|
8
|
-
return typeof e != 'object';
|
9
|
-
})) {
|
10
|
-
console.log('[ DEBUG ', ...message, ' ]');
|
11
|
-
} else {
|
12
|
-
console.log('[ DEBUG ');
|
13
|
-
console.table(message);
|
14
|
-
console.log(' ]');
|
15
|
-
}
|
1
|
+
import { isDebugMode as o } from './is-debug-mode.js';
|
2
|
+
export function debug(...e) {
|
3
|
+
o() && (e.every((o)=>'object' != typeof o) ? console.log('[ DEBUG ', ...e, ' ]') : (console.log('[ DEBUG '), console.table(e), console.log(' ]')));
|
16
4
|
}
|
17
5
|
|
18
6
|
//# sourceMappingURL=debug.js.map
|
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('[ 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"],"
|
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"],"mappings":"AAAA,SAASA,eAAAA,CAAW,QAAQ,qBAAqB;AAMjD,OAAO,SAASC,MAAM,GAAGC,CAAc;IAChCF,QAEHE,EAAQC,KAAK,CAAC,CAACC,IACN,AAAY,YAAZ,OAAOA,KAGhBC,QAAQC,GAAG,CAAC,gBAAgBJ,GAAS,UAErCG,QAAQC,GAAG,CAAC,aACZD,QAAQE,KAAK,CAACL,IACdG,QAAQC,GAAG,CAAC;AAEhB"}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
export const DEBUG_MODE = 'DEBUG_MODE';
|
2
2
|
export function isDebugMode() {
|
3
3
|
return [
|
4
|
-
|
4
|
+
!0,
|
5
5
|
'true',
|
6
6
|
1
|
7
7
|
].some((e)=>process.env[DEBUG_MODE] === e);
|
8
8
|
}
|
9
9
|
export function debugMode() {
|
10
10
|
return {
|
11
|
-
[DEBUG_MODE]:
|
11
|
+
[DEBUG_MODE]: !0
|
12
12
|
};
|
13
13
|
}
|
14
14
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/lib/is-debug-mode.ts"],"sourcesContent":["export const DEBUG_MODE = 'DEBUG_MODE';\r\n\r\nexport function isDebugMode(): boolean {\r\n return [true, 'true', 1].some((e) => process.env[DEBUG_MODE] === e);\r\n}\r\n\r\nexport function debugMode() {\r\n return {\r\n [DEBUG_MODE]: true,\r\n };\r\n}\r\n"],"names":["DEBUG_MODE","isDebugMode","some","e","process","env","debugMode"],"
|
1
|
+
{"version":3,"sources":["../../src/lib/is-debug-mode.ts"],"sourcesContent":["export const DEBUG_MODE = 'DEBUG_MODE';\r\n\r\nexport function isDebugMode(): boolean {\r\n return [true, 'true', 1].some((e) => process.env[DEBUG_MODE] === e);\r\n}\r\n\r\nexport function debugMode() {\r\n return {\r\n [DEBUG_MODE]: true,\r\n };\r\n}\r\n"],"names":["DEBUG_MODE","isDebugMode","some","e","process","env","debugMode"],"mappings":"AAAA,OAAO,MAAMA,aAAa,aAAa;AAEvC,OAAO,SAASC;IACd,OAAO;QAAC,CAAA;QAAM;QAAQ;KAAE,CAACC,IAAI,CAAC,CAACC,IAAMC,QAAQC,GAAG,CAACL,WAAW,KAAKG;AACnE;AAEA,OAAO,SAASG;IACd,OAAO;QACL,CAACN,WAAW,EAAE,CAAA;IAChB;AACF"}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
{
|
2
|
+
"name": "@puq/debug",
|
3
|
+
"license": "MIT",
|
4
|
+
"version": "0.3.2",
|
5
|
+
"publishConfig": {
|
6
|
+
"access": "public",
|
7
|
+
"tag": "latest"
|
8
|
+
},
|
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
|
+
"author": {
|
11
|
+
"email": "robert.brightline@gmail.com",
|
12
|
+
"name": "Robert Brightline",
|
13
|
+
"url": "https://rbrightline.github.io"
|
14
|
+
},
|
15
|
+
"keywords": [
|
16
|
+
"puq",
|
17
|
+
"debug"
|
18
|
+
],
|
19
|
+
"repository": {
|
20
|
+
"directory": "libs/debug",
|
21
|
+
"url": "https://github.com/rbrightline/puq/tree/main",
|
22
|
+
"type": "github"
|
23
|
+
},
|
24
|
+
"homepage": "https://rbrightline.github.io/puq/debug",
|
25
|
+
"bugs": {
|
26
|
+
"email": "robert.brightline@gmail.com",
|
27
|
+
"url": "https://rbrightline.github.io"
|
28
|
+
},
|
29
|
+
"categories": [
|
30
|
+
"Other"
|
31
|
+
],
|
32
|
+
"contributors": [
|
33
|
+
{
|
34
|
+
"email": "robert.brightline@gmail.com",
|
35
|
+
"name": "Robert Brightline",
|
36
|
+
"url": "https://rbrightline.github.io"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
"funding": [
|
40
|
+
"https://cash.app/$puqlib"
|
41
|
+
],
|
42
|
+
"icon": "https://raw.githubusercontent.com/rbrightline/puq/refs/heads/main/libs/debug/favicon.png",
|
43
|
+
"type": "module",
|
44
|
+
"main": "./dist/index.js",
|
45
|
+
"module": "./dist/index.js",
|
46
|
+
"types": "./dist/index.d.ts",
|
47
|
+
"exports": {
|
48
|
+
"./package.json": "./package.json",
|
49
|
+
".": {
|
50
|
+
"types": "./dist/index.d.ts",
|
51
|
+
"import": "./dist/index.js",
|
52
|
+
"default": "./dist/index.js"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"files": [
|
56
|
+
"dist",
|
57
|
+
"!**/*.tsbuildinfo"
|
58
|
+
],
|
59
|
+
"nx": {
|
60
|
+
"sourceRoot": "libs/debug/src",
|
61
|
+
"targets": {
|
62
|
+
"build": {
|
63
|
+
"executor": "@nx/js:swc",
|
64
|
+
"outputs": [
|
65
|
+
"{options.outputPath}"
|
66
|
+
],
|
67
|
+
"options": {
|
68
|
+
"outputPath": "libs/debug/dist",
|
69
|
+
"main": "libs/debug/src/index.ts",
|
70
|
+
"tsConfig": "libs/debug/tsconfig.lib.json",
|
71
|
+
"skipTypeCheck": false,
|
72
|
+
"stripLeadingPaths": true
|
73
|
+
},
|
74
|
+
"dependsOn": [
|
75
|
+
"lint"
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"doc": {
|
79
|
+
"command": "cd libs/debug && npx compodoc -d ../../public/debug -p tsconfig.lib.json -n debug"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
"dependencies": {
|
84
|
+
"@swc/helpers": "^0.5.15"
|
85
|
+
}
|
86
|
+
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@puq/debug",
|
3
3
|
"license": "MIT",
|
4
|
-
"version": "0.3.
|
4
|
+
"version": "0.3.3",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public",
|
7
7
|
"tag": "latest"
|
@@ -70,14 +70,17 @@
|
|
70
70
|
"tsConfig": "libs/debug/tsconfig.lib.json",
|
71
71
|
"skipTypeCheck": false,
|
72
72
|
"stripLeadingPaths": true
|
73
|
-
}
|
73
|
+
},
|
74
|
+
"dependsOn": [
|
75
|
+
"lint"
|
76
|
+
]
|
74
77
|
},
|
75
78
|
"doc": {
|
76
79
|
"command": "cd libs/debug && npx compodoc -d ../../public/debug -p tsconfig.lib.json -n debug"
|
77
80
|
}
|
78
81
|
}
|
79
82
|
},
|
80
|
-
"
|
81
|
-
"@swc/helpers": "
|
83
|
+
"dependencies": {
|
84
|
+
"@swc/helpers": "^0.5.15"
|
82
85
|
}
|
83
86
|
}
|