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

21 lines (16 loc) 572 B
define(['../array/slice', '../array/contains'], function(slice, contains){ /** * Return a copy of the object, filtered to only contain properties except the blacklisted keys. */ function omit(obj, var_keys){ var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), out = {}; for (var property in obj) { if (obj.hasOwnProperty(property) && !contains(keys, property)) { out[property] = obj[property]; } } return out; } return omit; });