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