|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
530 bytes
|
| Line | |
|---|
| 1 | import cb from './_cb.js';
|
|---|
| 2 | import keys from './keys.js';
|
|---|
| 3 |
|
|---|
| 4 | // Returns the results of applying the `iteratee` to each element of `obj`.
|
|---|
| 5 | // In contrast to `_.map` it returns an object.
|
|---|
| 6 | export default function mapObject(obj, iteratee, context) {
|
|---|
| 7 | iteratee = cb(iteratee, context);
|
|---|
| 8 | var _keys = keys(obj),
|
|---|
| 9 | length = _keys.length,
|
|---|
| 10 | results = {};
|
|---|
| 11 | for (var index = 0; index < length; index++) {
|
|---|
| 12 | var currentKey = _keys[index];
|
|---|
| 13 | results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
|
|---|
| 14 | }
|
|---|
| 15 | return results;
|
|---|
| 16 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.