Skip to content

Commit

Permalink
Merge pull request #2 from biowonks/develop
Browse files Browse the repository at this point in the history
using lodash.cloneDeep to make a deep copy of the input
  • Loading branch information
daviortega authored Oct 17, 2017
2 parents 0a9be34 + c4d4ec3 commit 57f50e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
}
],
"dependencies": {
"bunyan": "^1.8.8"
"bunyan": "^1.8.8",
"lodash": "^4.17.4"
},
"devDependencies": {
"chai": "^3.5.0",
Expand Down
4 changes: 3 additions & 1 deletion src/PFQLService.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

let lodash = require('lodash')

let PFQLCore = require('./PFQLCore.js')

module.exports =
Expand Down Expand Up @@ -38,7 +40,7 @@ class PFQLService {
}

findMatches(item) {
let newItem = JSON.parse(JSON.stringify(item))
let newItem = lodash.cloneDeep(item)
let matchList = []
this.parsedSetsOfRules.forEach((parsedRules, ruleIndex) => {
let DAarrayInfo = this._processFeaturesInfo(newItem, ruleIndex),
Expand Down

0 comments on commit 57f50e4

Please sign in to comment.