puvox-library 1.0.18 → 1.0.20
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 +12 -19
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -68,7 +68,7 @@ const puvox_library =
|
|
68
68
|
removeKeys(obj, keysArr){
|
69
69
|
let newObj ={};
|
70
70
|
for (let [key,val] of Object.entries(obj)){
|
71
|
-
if (!this.inArray(keysArr
|
71
|
+
if (!this.inArray(key,keysArr))
|
72
72
|
newObj[key]=val;
|
73
73
|
}
|
74
74
|
return newObj;
|
@@ -76,7 +76,7 @@ const puvox_library =
|
|
76
76
|
removeKeysExcept (obj, keysArr){
|
77
77
|
let newObj ={};
|
78
78
|
for (let [key,val] of Object.entries(obj)){
|
79
|
-
if (this.inArray(keysArr
|
79
|
+
if (this.inArray(key,keysArr))
|
80
80
|
newObj[key]=val;
|
81
81
|
}
|
82
82
|
return newObj;
|
@@ -383,9 +383,9 @@ const puvox_library =
|
|
383
383
|
isArray(x) { return ( (!!x) && (x.constructor === Array) ) || (Array.isArray(x)); },
|
384
384
|
|
385
385
|
isSimpleVariableType(obj){ return this.isSimpleVariableTypeName(typeof obj); },
|
386
|
-
isSimpleVariableTypeName(typeName_){ return this.inArray( [ "boolean", "integer", "float", "double", "decimal", "string"]
|
386
|
+
isSimpleVariableTypeName(typeName_){ return this.inArray( typeName_, [ "boolean", "integer", "float", "double", "decimal", "string"]); },
|
387
387
|
isNumericVariableType(obj){ return this.isNumericVariableTypeName(typeof obj); },
|
388
|
-
isNumericVariableTypeName(typeName_){ return this.inArray( [ "integer", "float", "double", "decimal"]
|
388
|
+
isNumericVariableTypeName(typeName_){ return this.inArray(typeName_, [ "integer", "float", "double", "decimal"]); },
|
389
389
|
|
390
390
|
stringToBoolean(string){
|
391
391
|
switch(string.toLowerCase().trim()){
|
@@ -625,7 +625,7 @@ const puvox_library =
|
|
625
625
|
}
|
626
626
|
},
|
627
627
|
argvIsSet(which){
|
628
|
-
return this.inArray(this.
|
628
|
+
return this.inArray(which, this.argvsArray()) || this.argv(which)!=undefined;
|
629
629
|
},
|
630
630
|
|
631
631
|
|
@@ -862,9 +862,8 @@ const puvox_library =
|
|
862
862
|
areSameDays(d1, d2){ },
|
863
863
|
|
864
864
|
|
865
|
-
// #######################
|
866
865
|
// ##### added to JS #####
|
867
|
-
|
866
|
+
GetDayOfYear(dt) { return (dt || new Date()).getUTCDate(); },
|
868
867
|
StringToUtcString(str) {
|
869
868
|
return str.indexOf ('Z') > -1 || str.indexOf ('GMT') > -1 ? str : str + ' GMT+0000';
|
870
869
|
},
|
@@ -1769,23 +1768,17 @@ const puvox_library =
|
|
1769
1768
|
// ========================================================== //
|
1770
1769
|
|
1771
1770
|
|
1772
|
-
inArray(
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
//} else
|
1778
|
-
{
|
1779
|
-
if(haystack[i] == needle) return true;
|
1780
|
-
}
|
1781
|
-
}
|
1782
|
-
return false;
|
1771
|
+
inArray(needle, haystack) {
|
1772
|
+
return haystack.indexOf(needle) > -1;
|
1773
|
+
},
|
1774
|
+
inKeys(key, obj){
|
1775
|
+
return key in obj;
|
1783
1776
|
},
|
1784
1777
|
|
1785
1778
|
partialObject(object_, array_) {
|
1786
1779
|
let newObj ={};
|
1787
1780
|
for (let [key, value] of Object.entries(object_)) {
|
1788
|
-
if( this.inArray(
|
1781
|
+
if( this.inArray(key, array_)){
|
1789
1782
|
newObj[key] = value;
|
1790
1783
|
}
|
1791
1784
|
}
|