Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/safris/object-prototype-filter
Object prototype supplementary filtration functions
https://github.com/safris/object-prototype-filter
Last synced: 1 day ago
JSON representation
Object prototype supplementary filtration functions
- Host: GitHub
- URL: https://github.com/safris/object-prototype-filter
- Owner: safris
- License: mit
- Created: 2016-11-24T08:07:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T01:59:57.000Z (about 7 years ago)
- Last Synced: 2024-11-09T06:52:04.274Z (6 days ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## object-prototype-filter
[![CohesionFirst](https://img.shields.io/badge/CohesionFirst%E2%84%A2--blue.svg)](https://cohesionfirst.com/) [![JavaCommons](https://img.shields.io/badge/angular-js-red.svg)](https://cohesionfirst.com/) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt) [![npm version](https://badge.fury.io/js/object-prototype-filter.svg)](http://badge.fury.io/js/object-prototype-filter)This is a set of supplementary prototype additions to the Object class that provide filtration functions analogous to that of `Array.prototype.filter()`.
_[Comments and Issues](https://github.com/SevaSafris/object-prototype-filter/issues)_
### Installation
##### NPM
```tcsh
npm install --save object-prototype-filter
```##### Bower
```tcsh
bower install --save object-prototype-filter
```##### Manual
```html```
#### Usage
This supplement adds the following prototype methods to the Object class:
1. **`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:
**`key`** the current key being processed in the object.
**`object`** the object filter was called upon.
**`thisArg`** Optional. 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](LICENSE.txt) file for details