1.0.4 • Published 10 years ago

underscore.has-inside v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

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
1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago