sergeyt / update-it

Functions to update javascript object tree.
MIT License
0 stars 0 forks source link

Remove lodash? #60

Open jimmywarting opened 7 years ago

jimmywarting commented 7 years ago

Think lodash just brings unnecessary dependencies and makes the final source just becomes larger

Example you can do instead:

// _.forOwn(obj, (val, key) => {
for (let [key, val] of Object.entries(obj)) {
  ...
}

// if (_.isFunction(update)) {
typeof update === 'function'

// if (_.isArray(val)) {
Array.isArray(val)

// if (_.isObject(val)) {
typeof val === 'object'

// _.forEach(array, (t, i) => {
array.forEach

// _.filter(list, t => t.id !== id);
array.filter
sergeyt commented 7 years ago

@jimmywarting please feel to make a PR! Also we could import only used functions from lodash to deacrease output bundle or use babel-lodash-plugin.