You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

curried-filter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curried-filter

A curried application of [].filter

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

curried-filter

A curried application of [].filter.

import filter from 'curried-filter';

Promise.resolve([0,1,2])
	.then( filter(a=>a<2) );

API

filter(fn, items)

fn is any function compatible with [].filter.

items is an array.

Returns a new array of filtered items.

filter(fn)

fn is any function compatible with [].filter.

Returns a new function which expects an array. When the returned function is executed with an array parameter, it returns a filtered array.

var gt5 = filter(n=>n>5);

gt5([2,3,5,6,7]); // [6, 7]
gt5([5, 10, 15, 20]); // [10, 15, 20]

Keywords

filter

FAQs

Package last updated on 03 Nov 2015

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