Skip to content

Commit cce5a62

Browse files
committed
fix(Revert): "compat: remove Object.assign fallback (#25)"
This reverts commit 627ab55.
1 parent a815ec9 commit cce5a62

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

git-host.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22
var gitHosts = require('./git-host-info.js')
3+
var extend = Object.assign || require('util')._extend
34

45
var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) {
56
var gitHostInfo = this
@@ -22,9 +23,9 @@ GitHost.prototype.hash = function () {
2223

2324
GitHost.prototype._fill = function (template, opts) {
2425
if (!template) return
25-
var vars = Object.assign({}, opts)
26+
var vars = extend({}, opts)
2627
vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : ''
27-
opts = Object.assign({}, this.opts, opts)
28+
opts = extend(extend({}, this.opts), opts)
2829
var self = this
2930
Object.keys(this).forEach(function (key) {
3031
if (self[key] != null && vars[key] == null) vars[key] = self[key]
@@ -117,7 +118,7 @@ GitHost.prototype.tarball = function (opts) {
117118
}
118119

119120
GitHost.prototype.file = function (P, opts) {
120-
return this._fill(this.filetemplate, Object.assign({ path: P }, opts))
121+
return this._fill(this.filetemplate, extend({ path: P }, opts))
121122
}
122123

123124
GitHost.prototype.getDefaultRepresentation = function () {

package.json

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"bitbucket",
1414
"gitlab"
1515
],
16-
"engines": {
17-
"node": ">=4"
18-
},
1916
"author": "Rebecca Turner <[email protected]> (http://re-becca.org)",
2017
"license": "ISC",
2118
"bugs": {

0 commit comments

Comments
 (0)