Socket
Socket
Sign inDemoInstall

reduce-extract

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    reduce-extract

reduce-extract


Version published
Maintainers
1
Install size
47.9 kB
Created

Readme

Source

view on npm npm module downloads Build Status Dependency Status js-standard-style

reduce-extract

extract(query) ⏏

Removes items from array which satisfy the query. Modifies the input array, returns the extracted.

Kind: Exported function

ParamTypeDescription
queryArraythe input array, modified directly
anyif an item in the input array passes this test it is removed

Example

> DJs = [
    { name: "Trevor", sacked: true },
    { name: "Mike", sacked: true },
    { name: "Chris", sacked: false },
    { name: "Alan", sacked: false }
]

> a.extract(DJs, { sacked: true })
[ { name: 'Trevor', sacked: true },
  { name: 'Mike', sacked: true } ]

> DJs
[ { name: 'Chris', sacked: false },
  { name: 'Alan', sacked: false } ]

© 2016 Lloyd Brookes 75pound@gmail.com. Documented by jsdoc-to-markdown.

FAQs

Last updated on 25 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc