@magnetarjs/utils
Advanced tools
Comparing version 0.13.3 to 0.13.4
@@ -105,2 +105,8 @@ "use strict"; | ||
} | ||
function passesQuery(docData, queryClause) { | ||
if ("and" in queryClause) { | ||
return (0, import_is_what2.isArray)(queryClause.and) ? queryClause.and.every((whereClause) => passesWhere(docData, whereClause)) : passesQuery(docData, queryClause.and); | ||
} | ||
return (0, import_is_what2.isArray)(queryClause.or) ? queryClause.or.some((whereClause) => passesWhere(docData, whereClause)) : passesQuery(docData, queryClause.or); | ||
} | ||
function filterDataPerClauses(collectionDB, clauses) { | ||
@@ -116,9 +122,9 @@ const queryClauses = clauses.query || []; | ||
collectionDB.forEach((docData, docId) => { | ||
const passesQuery = queryClauses.every((queryClause) => passesQuery(docData, queryClause)); | ||
if (!passesQuery) | ||
const passedQuery = queryClauses.every((queryClause) => passesQuery(docData, queryClause)); | ||
if (!passedQuery) | ||
return; | ||
const passesWhereFilters = whereClauses.every( | ||
const passedWhereFilters = whereClauses.every( | ||
(whereClause) => passesWhere(docData, whereClause) | ||
); | ||
if (!passesWhereFilters) | ||
if (!passedWhereFilters) | ||
return; | ||
@@ -125,0 +131,0 @@ entries.push([docId, docData]); |
{ | ||
"name": "@magnetarjs/utils", | ||
"version": "0.13.3", | ||
"version": "0.13.4", | ||
"sideEffects": false, | ||
@@ -27,3 +27,3 @@ "description": "Magnetar utils like a logger for easier development", | ||
"path-to-prop": "^2.0.2", | ||
"@magnetarjs/types": "0.13.3" | ||
"@magnetarjs/types": "0.13.4" | ||
}, | ||
@@ -30,0 +30,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
17747
408
+ Added@magnetarjs/types@0.13.4(transitive)
- Removed@magnetarjs/types@0.13.3(transitive)
Updated@magnetarjs/types@0.13.4