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

19 lines (15 loc) 500 B
var forOwn = require('./forOwn'); var makeIterator = require('../function/makeIterator_'); /** * Creates a new object where all the values are the result of calling * `callback`. */ function mapValues(obj, callback, thisObj) { callback = makeIterator(callback, thisObj); var output = {}; forOwn(obj, function(val, key, obj) { output[key] = callback(val, key, obj); }); return output; } module.exports = mapValues;