12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- '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;
|