# object-filter-sequence

> Apply a sequence of filter functions to an object

Latest version **1.0.0** (published 2019-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-filter-sequence
pnpm add object-filter-sequence
yarn add object-filter-sequence
bun add object-filter-sequence
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-01-30 |
| First published | 2019-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Stephen Belanger |
| Maintainers | qard |
| Keywords | object, filter, sequence |

## Links

- npm: https://www.npmjs.com/package/object-filter-sequence
- Repository: https://github.com/elastic/object-filter-sequence
- Homepage: https://github.com/elastic/object-filter-sequence#readme
- Issues: https://github.com/elastic/object-filter-sequence/issues
- npm.io page: https://npm.io/package/object-filter-sequence

## Recent versions

- 1.0.0 (latest) — 2019-01-30

## README

# object-filter-sequence

[![npm](https://img.shields.io/npm/v/object-filter-sequence.svg)](https://www.npmjs.com/package/object-filter-sequence)
[![Build status](https://travis-ci.org/elastic/object-filter-sequence.svg?branch=master)](https://travis-ci.org/elastic/object-filter-sequence)
[![codecov](https://img.shields.io/codecov/c/github/elastic/object-filter-sequence.svg)](https://codecov.io/gh/elastic/object-filter-sequence)
[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

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

```js
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](LICENSE)

---
_Source: https://npm.io/package/object-filter-sequence · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
