object-prototype-filter
v1.0.1
Published
Prototype filter function for objects
Maintainers
Readme
object-prototype-filter
This is a set of supplementary prototype additions to the Object class that provide filtration
funcitons analogous to that of Array.prototype.filter().
Installation
NPM
npm install --save object-prototype-filterBower
bower install --save object-prototype-filterManual
<script src="path/to/directory/object-prototype-filter.js"></script>Usage
This supplement adds the following prototype methods to the Object class:
Object.prototype.filterValues(callback)- Creates a new object with all entries that pass the test implemented by the provided function.callback(key, object, thisArg)Function is a predicate, to test each element of the array. Return true to keep the element, false otherwise, taking two arguments:
keythe current key being processed in the object.
objectthe object filter was called upon.
thisArgOptional. Value to use as this when executing callback.return A new objet with the elements that pass the test.
Development
npm run build- Build and minify
License
This project is licensed under the MIT License - see the LICENSE.txt file for details
