filter-array-of-objects
Advanced tools
Comparing version 1.0.9 to 1.1.0
16
index.js
@@ -21,9 +21,13 @@ const _ = require("lodash"); | ||
module.exports = function (arrObj, properties) { | ||
_.forEach(arrObj, function (obj, i) { | ||
if (obj != null || obj != undefined) { | ||
arrObj[i] = new Obj(properties, obj); | ||
} | ||
}); | ||
if (Array.isArray(arrObj)) { | ||
_.forEach(arrObj, function (obj, i) { | ||
if (obj != null || obj != undefined) { | ||
arrObj[i] = new Obj(properties, obj); | ||
} | ||
}); | ||
arrObj.sort(compare); | ||
arrObj.sort(compare); | ||
} else if (typeof yourVariable === 'object' && yourVariable !== null) { | ||
arrObj = new Obj(properties, arrObj); | ||
} | ||
} |
{ | ||
"name": "filter-array-of-objects", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Filter propertie of array of objects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1054
26