|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
356 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { identity } from '../../function/identity.mjs';
|
|---|
| 2 |
|
|---|
| 3 | function forIn(object, iteratee = identity) {
|
|---|
| 4 | if (object == null) {
|
|---|
| 5 | return object;
|
|---|
| 6 | }
|
|---|
| 7 | for (const key in object) {
|
|---|
| 8 | const result = iteratee(object[key], key, object);
|
|---|
| 9 | if (result === false) {
|
|---|
| 10 | break;
|
|---|
| 11 | }
|
|---|
| 12 | }
|
|---|
| 13 | return object;
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | export { forIn };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.