puvox-library 1.0.57 → 1.0.58
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/library_standard.js +25 -2
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -359,6 +359,12 @@ const puvox_library =
|
|
359
359
|
},
|
360
360
|
removeAllWhitespaces(content){ return content.replace(/\s/g,''); },
|
361
361
|
|
362
|
+
replaceAllOccurences (input, search, replacement) {
|
363
|
+
const splited = input.split (search);
|
364
|
+
const joined = splited.join (replacement);
|
365
|
+
return joined;
|
366
|
+
},
|
367
|
+
|
362
368
|
// ####################### TYPE ##############################
|
363
369
|
|
364
370
|
getVariableType(x) {
|
@@ -793,7 +799,24 @@ const puvox_library =
|
|
793
799
|
return array;
|
794
800
|
},
|
795
801
|
|
796
|
-
|
802
|
+
// avoid ccxt's bug for undefined : https://jsfiddle.net/Lpxsthw4/
|
803
|
+
mergeDeep(target, source) {
|
804
|
+
let output = Object.assign({}, target);
|
805
|
+
if (this.isObject(target) && this.isObject(source)) {
|
806
|
+
Object.keys(source).forEach(key => {
|
807
|
+
if (this.isObject(source[key])) {
|
808
|
+
if (!(key in target))
|
809
|
+
Object.assign(output, { [key]: source[key] });
|
810
|
+
else
|
811
|
+
output[key] = this.mergeDeep(target[key], source[key]);
|
812
|
+
} else {
|
813
|
+
const val= source[key] !== undefined ? source[key] : target[key];
|
814
|
+
Object.assign(output, { [key]: val });
|
815
|
+
}
|
816
|
+
});
|
817
|
+
}
|
818
|
+
return output;
|
819
|
+
},
|
797
820
|
|
798
821
|
getScrollbarWidth() {
|
799
822
|
var outer = document.createElement("div");
|
@@ -3338,7 +3361,7 @@ const puvox_library =
|
|
3338
3361
|
const ns = xs.filter (isNumber); // leave only numbers
|
3339
3362
|
return (ns.length > 0) ? ns.reduce ((a, b) => a + b, 0) : undefined;
|
3340
3363
|
},
|
3341
|
-
deepExtend
|
3364
|
+
deepExtend(...xs) {
|
3342
3365
|
let out = undefined;
|
3343
3366
|
for (const x of xs) {
|
3344
3367
|
if (this.isDictionary (x)) {
|