UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

26 lines (20 loc) 552 B
var makeIterator = require('../function/makeIterator_'); /** * Array reject */ function reject(arr, callback, thisObj) { callback = makeIterator(callback, thisObj); var results = []; if (arr == null) { return results; } var i = -1, len = arr.length, value; while (++i < len) { value = arr[i]; if (!callback(value, i, arr)) { results.push(value); } } return results; } module.exports = reject;