Skip to content

Commit

Permalink
Use Object.assign instead of xtend
Browse files Browse the repository at this point in the history
As described by choojs#563:

> https://polyfill.io provides a fallback for browsers that don't support it, so for most people this will be a strict improvement.
  • Loading branch information
bates64 committed Jan 5, 2018
1 parent 2dab1b5 commit 171875e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var nanohref = require('nanohref')
var nanoraf = require('nanoraf')
var nanobus = require('nanobus')
var assert = require('assert')
var xtend = require('xtend')

module.exports = Choo

Expand Down Expand Up @@ -49,7 +48,7 @@ function Choo (opts) {
var events = { events: this._events }
if (this._hasWindow) {
this.state = window.initialState
? xtend(window.initialState, events)
? Object.assign({}, window.initialState, events)
: events
delete window.initialState
} else {
Expand Down Expand Up @@ -196,7 +195,7 @@ Choo.prototype.mount = function mount (selector) {
}

Choo.prototype.toString = function (location, state) {
this.state = xtend(this.state, state || {})
Object.assign(this.state, state || {})

assert.notEqual(typeof window, 'object', 'choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser')
assert.equal(typeof location, 'string', 'choo.toString: location should be type string')
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"nanoraf": "^3.0.0",
"nanorouter": "^2.0.0",
"nanotiming": "^6.0.0",
"scroll-to-anchor": "^1.0.0",
"xtend": "^4.0.1"
"scroll-to-anchor": "^1.0.0"
},
"devDependencies": {
"@types/node": "^8.0.20",
Expand Down

0 comments on commit 171875e

Please sign in to comment.