Skip to content

Commit

Permalink
Remove xtend dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Nov 12, 2021
1 parent 9d6fff5 commit fbcba58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const Finder = require('./lib/finder')
const xtend = require('xtend')
const after = require('after')

const DEFAULTS = {
Expand All @@ -19,9 +18,9 @@ module.exports = function detect (names, opts, done) {

if (typeof opts === 'function') {
done = opts
opts = xtend(DEFAULTS)
opts = Object.assign({}, DEFAULTS)
} else {
opts = xtend(DEFAULTS, opts)
opts = Object.assign({}, DEFAULTS, opts)
}

if (!names || !names.length) {
Expand Down
3 changes: 1 addition & 2 deletions lib/finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const mt = require('pe-machine-type')
const util = require('util')
const path = require('path')
const existent = require('existent')
const xtend = require('xtend')
const Emitter = require('events').EventEmitter
const registry = require('./registry')

Expand Down Expand Up @@ -223,7 +222,7 @@ Finder.prototype.found = function (bin, metadata, method, cb, _skipPre) {
} else if (id.slice(-4) === '.exe') { // Ignore non-executable's
let b = versionInfo({ name: this.name, path: bin })

if (b && metadata) b = xtend(metadata, b)
if (b && metadata) b = Object.assign({}, metadata, b)
if (b && this.post) b = this.post(b)

if (b) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"which": "^2.0.1",
"win-version-info": "^5.0.1",
"windows-env": "^1.0.1",
"xtend": "^4.0.0",
"yargs": "^16.2.0"
},
"devDependencies": {
Expand Down

0 comments on commit fbcba58

Please sign in to comment.