@andreseloysv/filtermap
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

filterMap

Transforms an array of elements into a new array of elements based on specified filter and mapping functions.

Installation

npm install @andreseloysv/filtermap

Usage

Javascript

const filterMap = require('@andreseloysv/filtermap')

// Example usage:
const numbers = [1, 2, undefined, 3];
const result = filterAndMap(numbers, x => x < 3, x => `Number: ${x}`);
// result will be ['Number: 1', 'Number: 2']

Typescript

import { filterMap } from '@andreseloysv/filtermap';

const numbers = [1, 2, undefined, 3];
const result = filterAndMap(numbers, x => x < 3, x => `Number: ${x}`);
// result will be ['Number: 1', 'Number: 2']

Readme

Keywords

none

Package Sidebar

Install

npm i @andreseloysv/filtermap

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

11.8 kB

Total Files

11

Last publish

Collaborators

  • andreseloysv