From ed2d472e27ac8a5396a234d7744b68c8a4c9ca8e Mon Sep 17 00:00:00 2001 From: Nathan Hammond Date: Mon, 31 Oct 2016 20:12:00 -0700 Subject: [PATCH] Use object-assign for Node.js 0.12 support. --- lib/client.js | 9 +++++---- package.json | 5 +++-- yarn.lock | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/client.js b/lib/client.js index 94ba38f..e9da06a 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,5 +1,6 @@ -import events from 'events'; -import WebSocket from 'faye-websocket'; +import events from 'events'; +import WebSocket from 'faye-websocket'; +import objectAssign from 'object-assign'; const debug = require('debug')('tinylr:client'); @@ -44,12 +45,12 @@ export default class Client extends events.EventEmitter { info (data) { if (data) { debug('Info', data); - this.emit('info', Object.assign({}, data, { id: this.id })); + this.emit('info', objectAssign({}, data, { id: this.id })); this.plugins = data.plugins; this.url = data.url; } - return Object.assign({}, data || {}, { id: this.id, url: this.url }); + return objectAssign({}, data || {}, { id: this.id, url: this.url }); } // Server commands diff --git a/package.json b/package.json index 2747a54..33e8f41 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "debug": "~2.2.0", "faye-websocket": "~0.10.0", "livereload-js": "^2.2.2", + "object-assign": "^4.1.0", "qs": "^6.2.0" }, "devDependencies": { @@ -37,9 +38,9 @@ "express": "^4.1.1", "gaze": "^1.1.2", "mocha": "^2.3.3", + "npm-watch": "^0.1.6", "standard-version": "^2.2.1", - "supertest": "^1.2.0", - "npm-watch": "^0.1.6" + "supertest": "^1.2.0" }, "author": "mklabs", "homepage": "https://github.com/mklabs/tiny-lr", diff --git a/yarn.lock b/yarn.lock index 486a131..7d14061 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2570,14 +2570,14 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" +object-assign, object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + object-assign@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" - object.omit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.0.tgz#868597333d54e60662940bb458605dd6ae12fe94"