Socket
Socket
Sign inDemoInstall

object-filter

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    object-filter

`Array.prototype.filter` for objects


Version published
Weekly downloads
201K
decreased by-32.4%
Maintainers
1
Install size
3.78 kB
Created
Weekly downloads
 

Readme

Source

objfilter

Build Status

Array.prototype.filter for objects.

Usage

var assert = require('assert');
var objfilter = require('../');

var o1 = {
  a: 1,
  b: -1,
  c: 0,
  d: 42
};

objfilter(o1, function (n) {
  return n > 0;
}); // => `{ a: 1, d: 42 }`

API

objfilter(obj, iterator, this)

  • obj (object) - object to filter on
  • iterator (function, required) - iterator function
  • this (optional) - this for iterator

Creates a new object with all the elements that pass the test implemented by iterator.

Keywords

FAQs

Last updated on 29 Nov 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc