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

object-filter-sequence

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-filter-sequence

Apply a sequence of filter functions to an object

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
272K
increased by80.78%
Maintainers
1
Weekly downloads
 
Created
Source

object-filter-sequence

npm Build status codecov Standard - JavaScript Style Guide

This module provides an interface to apply a sequence of filters to an object. It is a subclass of Array, so any array method can be used on it.

Installation

npm install object-filter-sequence

Example Usage

const Filters = require('object-filter-sequence')

const filters = new Filters()

filters.push(previous => {
  const next = {}
  next.key = previous.key.toUpperCase()
  return next
})

filters.push(previous => {
  const next = {}
  next.key = previous.key.reverse()
  return next
})

filters.process({ key: 'value' }) // { key: 'EULAV' }

API

filters.process(object)

This is the only unique method from the Array base class. It is used to apply the filters in the array to the provided object.

License

MIT

Keywords

FAQs

Package last updated on 30 Jan 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc