Socket
Socket
Sign inDemoInstall

get-filtered

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    get-filtered

filter an array of object based on an array and a key


Version published
Maintainers
1
Install size
1.76 kB
Created

Readme

Source

Description

  • filter an array of object based on an array and a key

Install

npm i get-filtered

Usage

const {getFiltered} = require('getFiltered')

const data = [
    {
        id: 1,
        name: "USA",
        continent: "North America",
        planet: "Earth"
    },
    {
        id: 2,
        name: "Canada",
        planet: "Earth"
    },
    {
        id: 3,
        name: "Haiti",
        continent: "North America",
    }
]

const config = {
    inc: ["Earth"],
    filter_key: "planet"
}

const callback = (f) => {
    console.log(f)
    return f
}
const gotFiltered = getFiltered(data, config, callback)



FAQs

Last updated on 02 Oct 2020

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