Skip to content

Commit

Permalink
Avoid mutate state
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed May 15, 2018
1 parent 766bff3 commit 9a56e7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/metascraper/src/merge-rules.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { concat, first, findIndex, forEach, chain } = require('lodash')
const { cloneDeep, concat, first, findIndex, forEach, chain } = require('lodash')

module.exports = (rules, baseRules) => chain(rules)
.reduce((acc, rules) => {
Expand All @@ -10,5 +10,5 @@ module.exports = (rules, baseRules) => chain(rules)
else acc.push([propName, rule])
})
return acc
}, baseRules)
}, cloneDeep(baseRules))
.value()

0 comments on commit 9a56e7d

Please sign in to comment.