Skip to content

Commit

Permalink
Do not delete properties from option maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorribas committed Feb 12, 2016
1 parent 9df6a5d commit f6aafb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/figo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var https = require("https");
var tls = require("tls");
var querystring = require("querystring");
var models = require("./models");
var clone = require("clone");


// ### Global configuration.
Expand Down Expand Up @@ -717,7 +718,7 @@ var Session = function(access_token) {
// The result parameter is an array of `Security` objects.
//
this.get_securities = function(options, callback) {
options = options == null ? {} : options;
options = options == null ? {} : clone(options);
if (typeof options.since !== "undefined")
options.since = typeof options.since === "object" ? options.since.toISOString() : options.since;
options.count = typeof options.count === "undefined" ? 1000 : options.count;
Expand Down Expand Up @@ -779,7 +780,7 @@ var Session = function(access_token) {
// The result parameter is an array of `Transaction` objects, one for each transaction of the user.
//
this.get_transactions = function(options, callback) {
options = options == null ? {} : options;
options = options == null ? {} : clone(options);
if (typeof options.since !== "undefined")
options.since = typeof options.since === "object" ? options.since.toISOString() : options.since;
options.count = typeof options.count === "undefined" ? 1000 : options.count;
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
},
"engines": {
"node": ">=0.8.0"
},
"dependencies": {
"clone": "^1.0.2"
}
}

0 comments on commit f6aafb8

Please sign in to comment.