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

24 lines (19 loc) 490 B
define(['./has'], function (has) { /** * Unset object property. */ function unset(obj, prop){ if (has(obj, prop)) { var parts = prop.split('.'), last = parts.pop(); while (prop = parts.shift()) { obj = obj[prop]; } return (delete obj[last]); } else { // if property doesn't exist treat as deleted return true; } } return unset; });