object-some

1.0.0 • Public • Published

object-some

Build Status

Array.prototype.filter for objects.

Installation

npm install object-some

Usage

var assert = require('assert');
var objectSome = require('object-some');
 
var o1 = {
  a: 1,
  b: -1,
  c: 0,
  d: 42
};
 
objectSome(o1, function (n) {
  return n > 0;
}); // => `true`
 
objectSome(o1, function (n) {
  return n === 100'
}); // => `false`

API

objectSome(obj, iterator, this)

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

Iterates over obj, calls iterator(value, key, obj) with each item and returns true if it returns true when iterator returns true, false otherwise.

/object-some/

    Package Sidebar

    Install

    npm i object-some

    Weekly Downloads

    25

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • mmalecki