Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

About

Apply a sequence of filter functions to an object

Resources

Security policy

Stars

3 stars

Watchers

294 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

object-filter-sequence

npm Lint status Test status

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

About

Apply a sequence of filter functions to an object

Resources

Security policy

Stars

3 stars

Watchers

294 watching

Forks

Releases

Packages

Used by

Contributors

Languages