qtools-functional-library 1.1.7 → 1.1.10
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.
|
@@ -26,7 +26,7 @@ var moduleFunction = function(args = {}) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
this.log = function(message, options = {}) {
|
|
29
|
-
options.suffixCallStackDepth = 4;
|
|
29
|
+
options.suffixCallStackDepth = options.suffixCallStackDepth?options.suffixCallStackDepth:4;
|
|
30
30
|
return ({}.qtLog(message, options));
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -65,13 +65,21 @@ var moduleFunction = function(args = {}) {
|
|
|
65
65
|
noSuffix = false,
|
|
66
66
|
label = '',
|
|
67
67
|
substitutions = {},
|
|
68
|
-
destination = 'stderr'
|
|
68
|
+
destination = 'stderr',
|
|
69
|
+
removeFromSuffix,
|
|
70
|
+
replacementForSuffix='...'
|
|
69
71
|
} = options;
|
|
70
72
|
|
|
71
73
|
const callerName = commonFunctions.callerName(true, options);
|
|
72
74
|
|
|
73
75
|
const showLabel = label.replace(/\n/g, '');
|
|
74
|
-
|
|
76
|
+
let suffix = noSuffix ? '' : ` [${callerName}]`;
|
|
77
|
+
|
|
78
|
+
if (removeFromSuffix){
|
|
79
|
+
suffix=suffix.replace(new RegExp(removeFromSuffix), replacementForSuffix);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
75
83
|
const outputMessage =
|
|
76
84
|
message
|
|
77
85
|
.qtTemplateReplace(typeof this == 'object' ? this : {})
|
|
@@ -19,6 +19,12 @@ var moduleFunction = function(args = {}) {
|
|
|
19
19
|
let returnn = '';
|
|
20
20
|
let showLabel = '';
|
|
21
21
|
let suffix = '';
|
|
22
|
+
let cancelDump = args.cancelDump ? args.cancelDump : false;
|
|
23
|
+
|
|
24
|
+
if (cancelDump){
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
const recursionDepth =
|
|
23
29
|
typeof args.recursionDepth != 'undefined' ? args.recursionDepth : null;
|
|
24
30
|
const addCliColors =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qtools-functional-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Useful additions to JS prototypes to facilliate chainable, functional (mostly) style. Also make life more convenient.\"",
|
|
5
5
|
"main": "qtools-functional-library.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,5 +30,8 @@
|
|
|
30
30
|
"type": "MIT",
|
|
31
31
|
"url": "https://github.com/evangelion1204/multi-ini/blob/master/LICENSE"
|
|
32
32
|
}
|
|
33
|
-
]
|
|
33
|
+
],
|
|
34
|
+
"pkg":{
|
|
35
|
+
"assets":"./lib"
|
|
36
|
+
}
|
|
34
37
|
}
|