Comparing version 0.3.9 to 0.4.0
@@ -41,2 +41,6 @@ "use strict"; | ||
function itsAnOwnProperty(obj, attr){ | ||
return !obj.hasOwnProperty || obj.hasOwnProperty(attr) | ||
} | ||
function id(x){ return x; } | ||
@@ -74,3 +78,3 @@ | ||
var arr = []; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
arr.push(oThis[attr]); | ||
@@ -113,8 +117,8 @@ }} | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var result = f.call(fThis, oThis[attr], attr, oThis, i++); | ||
// eslint-disable-next-line guard-for-in | ||
for(var attrResult in result){ | ||
for(var attrResult in result){ if(itsAnOwnProperty(result,attrResult)){ | ||
acumulator[attrResult]=result[attrResult]; | ||
} | ||
}} | ||
}} | ||
@@ -127,8 +131,8 @@ return acumulator; | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var result = f.call(fThis, oThis[attr], attr, oThis, i++); | ||
// eslint-disable-next-line guard-for-in | ||
for(var attrResult in result){ | ||
for(var attrResult in result){ if(itsAnOwnProperty(result,attrResult)){ | ||
acumulator[attrResult]=result[attrResult]; | ||
} | ||
}} | ||
}} | ||
@@ -144,3 +148,3 @@ return acumulator; | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
i++; | ||
@@ -182,3 +186,3 @@ }} | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
f.call(fThis, oThis[attr], attr, oThis, i++); | ||
@@ -193,3 +197,3 @@ }} | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
acumulator[attr] = f.call(fThis, oThis[attr], attr, oThis, i++); | ||
@@ -203,3 +207,3 @@ }} | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
acumulator[attr] = f.call(fThis, oThis[attr], attr, oThis, i++); | ||
@@ -214,3 +218,3 @@ }} | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var value = oThis[attr]; | ||
@@ -227,3 +231,3 @@ if(f.call(fThis, value, attr, oThis, i++)){ | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var value = oThis[attr]; | ||
@@ -239,3 +243,3 @@ if(f.call(fThis, value, attr, oThis, i++)){ | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var value = oThis[attr]; | ||
@@ -251,3 +255,3 @@ if(f.call(fThis, value, attr, oThis, i++)){ | ||
var i=0; | ||
for(var attr in oThis){ if(oThis.hasOwnProperty(attr)){ | ||
for(var attr in oThis){ if(itsAnOwnProperty(oThis,attr)){ | ||
var value = oThis[attr]; | ||
@@ -323,3 +327,3 @@ if(f.call(fThis, value, attr, oThis, i++)){ | ||
for(var k in o){ | ||
return false; | ||
if(itsAnOwnProperty(o,k)) return false; | ||
} | ||
@@ -326,0 +330,0 @@ return true; |
{ | ||
"name": "like-ar", | ||
"description": "Using objects like arrays with map, filter, forEach and others coming soon.", | ||
"version": "0.3.9", | ||
"version": "0.4.0", | ||
"author": "Codenautas <codenautas@googlegroups.com>", | ||
@@ -15,13 +15,13 @@ "repository": "codenautas/like-ar", | ||
"devDependencies": { | ||
"@types/mocha": "~10.0.1", | ||
"discrepances": "0.2.6", | ||
"expect.js": "~0.3.1", | ||
"istanbul": "~0.4.5", | ||
"json4all": "~1.2.1", | ||
"mocha": "~10.2.0", | ||
"nyc": "~15.1.0", | ||
"typescript": "^4.9.5" | ||
"@types/mocha": "^10.0.6", | ||
"discrepances": "^0.2.8", | ||
"expect.js": "^0.3.1", | ||
"istanbul": "^0.4.5", | ||
"json4all": "^1.2.1", | ||
"mocha": "^10.4.0", | ||
"nyc": "^15.1.0", | ||
"typescript": "^5.4.3" | ||
}, | ||
"engines": { | ||
"node": ">= 4.0.0" | ||
"node": ">= 16.0.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
@@ -119,3 +119,3 @@ # like-ar | ||
### `LikeAr.createIndex(array:T[],keyName:string):{[k:string]: T}` | ||
### `LikeAr.createIndex(array:T[], keyName:string): Record<string, T>` | ||
@@ -137,3 +137,3 @@ Returns a plain object containing the same element indexed by keyName | ||
### `LikeAr.iterator<T>(arrayOrObject:T[]|Record<K,T>):Iterator<T>` | ||
### `LikeAr.iterator(arrayOrObject: T[] | Record<K,T>): Iterator<T>` | ||
@@ -155,3 +155,3 @@ Returns an Iterator<T> from an `Array<T>` or a `Record<K,T>`. | ||
### LikeAr.empty(arrayOrObject:T[]|Record<K,T>|null):boolean | ||
### `LikeAr.empty(arrayOrObject: T[] | Record<K,T> | null): boolean` | ||
@@ -158,0 +158,0 @@ Returns `false` if the arreglo or object has at least one value. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21762
328