Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filter-where

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter-where - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

index.js

13

package.json
{
"name": "filter-where",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.0.1",
"version": "2.0.0",
"description": "Filter an array using any combination of scalars, object queries, functions or regular expressions.",
"repository": "https://github.com/75lb/filter-where.git",
"license": "MIT",
"main": "./lib/filter-where.js",
"keywords": [

@@ -16,14 +15,14 @@ "where",

"engines": {
"node": ">=0.10.0"
"node": ">=6"
},
"scripts": {
"test": "tape test/*.js",
"docs": "jsdoc2md2 -t jsdoc2md/README.md lib/*.js > README.md; echo"
"test": "test-runner test.js",
"docs": "jsdoc2md -t jsdoc2md/README.hbs index.js > README.md; echo"
},
"devDependencies": {
"tape": "^4.4.0"
"test-runner": "^0.5.1"
},
"dependencies": {
"test-value": "^1.0.1"
"test-value": "^3.0.0"
}
}

@@ -8,16 +8,16 @@ [![view on npm](http://img.shields.io/npm/v/filter-where.svg)](https://www.npmjs.org/package/filter-where)

<a name="module_filter-where"></a>
## filter-where
Filter an array using any combination of scalars, object queries, functions or regular expressions.
<a name="exp_module_filter-where--where"></a>
<a name="exp_module_filter-where--where"></a>
### where(query) ⇒ `function` ⏏
### where(query) ⇒ <code>function</code> ⏏
**Kind**: Exported function
| Param | Type | Description |
| ----- | -------------------------- | ------------------- |
| query | `any` &#124; `Array.<any>` | one or more queries |
| Param | Type | Description |
| --- | --- | --- |
| query | <code>any</code> \| <code>Array.&lt;any&gt;</code> | one or more queries |
**Example**
**Example**
Say you have a recordset:

@@ -85,4 +85,4 @@ ```js

```js
> var nameBeginsWithY = { name: /^Y/ }
> var faveColourIncludesWhite = { favourite: { '+colour': 'white' } }
> const nameBeginsWithY = { name: /^Y/ }
> const faveColourIncludesWhite = { favourite: { '+colour': 'white' } }

@@ -94,7 +94,4 @@ > deepData.filter(where([ nameBeginsWithY, faveColourIncludesWhite ]))

* * *
&copy; 2016 Lloyd Brookes <75pound@gmail.com>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
&copy; 2016-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc