@jsdoc/salty
Advanced tools
Comparing version 0.1.1 to 0.2.0
const _ = require('lodash'); | ||
// Install shim for Object.hasOwn() if necessary. | ||
/* istanbul ignore next */ | ||
if (!Object.hasOwn) { | ||
@@ -66,2 +67,6 @@ Object.hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
matches = _.isUndefined(item[key]); | ||
} else if (Array.isArray(matcherValue)) { | ||
if (!matcherValue.includes(item[key])) { | ||
matches = false; | ||
} | ||
} else if (matcherValue !== item[key]) { | ||
@@ -68,0 +73,0 @@ matches = false; |
{ | ||
"name": "@jsdoc/salty", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "A drop-in replacement for (some of) TaffyDB.", | ||
@@ -28,5 +28,5 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=v12.0.0" | ||
"node": ">=v18.12.0" | ||
}, | ||
"gitHead": "1577d7f033b5395450e133e0734cfb7c43e1be86" | ||
"gitHead": "12da2f7ecc542117058a144af136d0d7c1bc344e" | ||
} |
@@ -103,5 +103,9 @@ # Salty | ||
// Get array of all items | ||
const allItems = db().get(); | ||
const emptyMatcher = db().get(); | ||
// Get array of items where `a` is either `1` or `3` | ||
const arrayMatcher = db({ a: [1, 3] }).get(); | ||
// Get array of items where `a` is `1` and `b` is `hello` | ||
const multiMatcher = db({ a: 1 }, { b: 'hello' }).get(); | ||
// Get array of items where `b` is undefined | ||
const someItems = db({ b: { isUndefined: true } }).get(); | ||
const undefinedMatcher = db({ b: { isUndefined: true } }).get(); | ||
``` | ||
@@ -108,0 +112,0 @@ |
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
24853
185
181