underscore.has-inside

1.0.4 • Public • Published

Build Status

underscore.hasInside

Check if an object or it's descendants fullfill a predicate

Installation

npm install underscore.has-inside

Usage

setup

        _.mixin(require('underscore.has-inside'));

findInside

Checks a predicate for an object and its descendant

        var obj = {
            foo: 'bar',
            moo: {
                boo: 'poo'
            },
            arrrr: [1,2,3,4]
        };
        _.findInside(obj, function(item) {
            return item.boo && item.boo === 'poo';
        });  // -> true

hasInside

Check if an object or it's descendants have a property

        var obj = {
            foo: 'bar',
            moo: {
                boo: 'poo'
            },
            arrrr: [1,2,3,4]
        };
        _.hasInside(obj, 'boo');  // -> true
 
        _.hasInside(obj, 'bar');  // -> false

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    1
  • 1.0.3
    0
  • 1.0.2
    1
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i underscore.has-inside

Weekly Downloads

2

Version

1.0.4

License

ISC

Last publish

Collaborators

  • schtoeffel