Skip to content

Commit

Permalink
clone params in scenario.trigger function so that original object is …
Browse files Browse the repository at this point in the history
…not modified
  • Loading branch information
Pierre-Gilles committed Nov 11, 2016
1 parent 2620920 commit ae88c2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/core/scenario/scenario.trigger.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
var queries = require('./scenario.queries.js');
var template = require('es6-template-strings');
var clone = require('clone');
var Promise = require('bluebird');

module.exports = function(params) {

// clone params so that original object is not affected
params = clone(params);

sails.log.info(`Scenario : Trigger : New event : ${params.code}`);

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"barrels": "^1.6.2",
"bcrypt": "^0.8.5",
"bluebird": "^3.3.4",
"clone": "^2.0.0",
"crypto": "~0.0.3",
"ejs": "^2.4.1",
"es6-template-strings": "^2.0.0",
Expand Down

0 comments on commit ae88c2a

Please sign in to comment.