Skip to content

Commit

Permalink
fix(compat): remove Object.assign fallback (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored and zkat committed Mar 7, 2018
1 parent 88da66d commit 627ab55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions git-host.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'
var gitHosts = require('./git-host-info.js')
var extend = Object.assign || require('util')._extend

var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) {
var gitHostInfo = this
Expand All @@ -23,8 +22,8 @@ GitHost.prototype.hash = function () {

GitHost.prototype._fill = function (template, opts) {
if (!template) return
var vars = extend({}, opts)
opts = extend(extend({}, this.opts), opts)
var vars = Object.assign({}, opts)
opts = Object.assign({}, this.opts, opts)
var self = this
Object.keys(this).forEach(function (key) {
if (self[key] != null && vars[key] == null) vars[key] = self[key]
Expand Down Expand Up @@ -100,7 +99,7 @@ GitHost.prototype.tarball = function (opts) {
}

GitHost.prototype.file = function (P, opts) {
return this._fill(this.filetemplate, extend({
return this._fill(this.filetemplate, Object.assign({
path: P.replace(/^[/]+/g, '')
}, opts))
}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"bitbucket",
"gitlab"
],
"engines": {
"node": ">=4"
},
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)",
"license": "ISC",
"bugs": {
Expand Down

0 comments on commit 627ab55

Please sign in to comment.