Use lodash's forEach
It's a lot faster
This commit is contained in:
parent
167760fb24
commit
efb669f017
@ -1,13 +1,6 @@
|
|||||||
import update from './update';
|
import update from './update';
|
||||||
import wrap from './wrap';
|
import wrap from './wrap';
|
||||||
|
import forEach from 'lodash/collection/forEach';
|
||||||
function forEach(object, callback) {
|
|
||||||
if (Array.isArray(object)) {
|
|
||||||
object.forEach(callback);
|
|
||||||
} else {
|
|
||||||
Object.keys(object).forEach((key) => callback(object[key], key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clone(object) {
|
function clone(object) {
|
||||||
if (Array.isArray(object)) {
|
if (Array.isArray(object)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user