123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 'use strict';
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function mapObject(object, callback, context) {
- if (!object) {
- return null;
- }
- var result = {};
- for (var name in object) {
- if (hasOwnProperty.call(object, name)) {
- result[name] = callback.call(context, object[name], name, object);
- }
- }
- return result;
- }
- module.exports = mapObject;
|