puvox-library 1.0.28 → 1.0.30
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 +21 -0
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -435,6 +435,21 @@ const puvox_library =
|
|
435
435
|
return result;
|
436
436
|
},
|
437
437
|
|
438
|
+
renameKey (obj, keyFrom, keyTo) {
|
439
|
+
for (const key of Object.keys(obj)) {
|
440
|
+
obj[keyTo] = obj[keyFrom];
|
441
|
+
delete obj[keyFrom];
|
442
|
+
}
|
443
|
+
return obj;
|
444
|
+
},
|
445
|
+
renameSubKey (obj, keyFrom, keyTo) {
|
446
|
+
for (const key of Object.keys(obj)) {
|
447
|
+
obj[key][keyTo] = obj[key][keyFrom];
|
448
|
+
delete obj[key][keyFrom];
|
449
|
+
}
|
450
|
+
return obj;
|
451
|
+
},
|
452
|
+
|
438
453
|
hasEmptyChild(obj){
|
439
454
|
let hasEmpty = false;
|
440
455
|
if(this.isObject(obj)) {
|
@@ -2354,6 +2369,12 @@ const puvox_library =
|
|
2354
2369
|
RemoveHashString(str){ var hash=str.split("#")[1]; return str.replace("#"+hash,''); },
|
2355
2370
|
// ===================================================================//
|
2356
2371
|
|
2372
|
+
arrayRemoveValue(array, value) {
|
2373
|
+
const newArray = [...array];
|
2374
|
+
const index = newArray.indexOf(value);
|
2375
|
+
newArray.splice(index, 1);
|
2376
|
+
return newArray;
|
2377
|
+
},
|
2357
2378
|
|
2358
2379
|
getCharsFromStart(str, amount){
|
2359
2380
|
return str.substring(0, amount);
|