Skip to content

Commit

Permalink
GitHub #2 - Fix default attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
sqmk committed Nov 1, 2015
1 parent ef405ad commit d0ac37c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Group {
* @param {string} id Id
*/
constructor(id, device) {
this.properties = DEFAULT_PROPERTIES;
this.properties = Object.assign({}, DEFAULT_PROPERTIES);
this.id = _.isEmpty(id) ? DEFAULT_PROPERTIES.id : id;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Message {
* @param {object} options Options
*/
constructor(options) {
this.properties = DEFAULT_PROPERTIES;
this.properties = Object.assign({}, DEFAULT_PROPERTIES);

for (let i in options) {
this[i] = options[i];
Expand Down
2 changes: 1 addition & 1 deletion lib/Receipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Receipt {
* @param {object} results Results
*/
constructor(id, results) {
this.properties = DEFAULT_PROPERTIES;
this.properties = Object.assign({}, DEFAULT_PROPERTIES);
this.properties.id = id;

for (let i in results) {
Expand Down
2 changes: 1 addition & 1 deletion lib/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class User {
* @param {string} device Device name
*/
constructor(id, device) {
this.properties = DEFAULT_PROPERTIES;
this.properties = Object.assign({}, DEFAULT_PROPERTIES);
this.id = _.isEmpty(id) ? DEFAULT_PROPERTIES.id : id;
this.device = _.isEmpty(device) ? DEFAULT_PROPERTIES.device : device;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chump",
"version": "1.0.3",
"version": "1.0.4",
"description": "Pushover.net client for Node.js",
"keywords": [
"pushover",
Expand Down Expand Up @@ -34,4 +34,4 @@
"sinon": "1.17.0",
"mockery": "1.4.0"
}
}
}

0 comments on commit d0ac37c

Please sign in to comment.