Skip to content

Commit

Permalink
Revert "fix(compat): remove Object.assign fallback (#25)"
Browse files Browse the repository at this point in the history
This reverts commit 627ab55.

Fixes: #31
  • Loading branch information
iarna committed Jun 25, 2018
1 parent cd5e5bb commit 0b7f9dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions git-host.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'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 @@ -22,9 +23,10 @@ GitHost.prototype.hash = function () {

GitHost.prototype._fill = function (template, opts) {
if (!template) return
var vars = extend({}, opts)
var vars = Object.assign({}, opts)
vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : ''
opts = Object.assign({}, this.opts, opts)
opts = extend(extend({}, 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 @@ -117,7 +119,7 @@ GitHost.prototype.tarball = function (opts) {
}

GitHost.prototype.file = function (P, opts) {
return this._fill(this.filetemplate, Object.assign({ path: P }, opts))
return this._fill(this.filetemplate, extend({ path: P }, opts))
}

GitHost.prototype.getDefaultRepresentation = function () {
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
"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 0b7f9dc

Please sign in to comment.