Skip to content

jonschlinkert/filter-functions

Repository files navigation

filter-functions NPM version

Filter an array to have only function values, or an object to have only properties with function values.

Install

Install with npm

$ npm i filter-functions --save

Usage

var functions = require('filter-functions');

var a = function(){};
var c = function(){};
var e = function(){};

var obj = {a: a, b: 'b', c: c, d: 'd', e: e};
functions(obj);
//=> {a: a, c: c, e: e});

functions([a, 'b', c, 'd', e]);
//=> [a, c, e]

Related projects

  • filter-keys: Filter the keys of an object using glob patterns.
  • filter-object: Return a copy of an object, filtered to have only keys that match the given… more
  • filter-values: Filter an object values using glob patterns or with a callback function returns true.

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on May 29, 2015.

About

Filter an array to have only function values, or an object to have only properties with function values.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published