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 wrap from './wrap';
|
||||
|
||||
function forEach(object, callback) {
|
||||
if (Array.isArray(object)) {
|
||||
object.forEach(callback);
|
||||
} else {
|
||||
Object.keys(object).forEach((key) => callback(object[key], key));
|
||||
}
|
||||
}
|
||||
import forEach from 'lodash/collection/forEach';
|
||||
|
||||
function clone(object) {
|
||||
if (Array.isArray(object)) {
|
||||
|
Loading…
Reference in New Issue
Block a user