From 297e6a504dd4c17c3e1f1638517af91c076dd8e2 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Tue, 12 Nov 2024 11:41:01 +0800 Subject: [PATCH] refactor: remove the extend library --- bin/nodeinstall.js | 1 - lib/install.js | 6 ++++-- package.json | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/nodeinstall.js b/bin/nodeinstall.js index f13f00e..285c63a 100755 --- a/bin/nodeinstall.js +++ b/bin/nodeinstall.js @@ -6,7 +6,6 @@ const install = require('../lib/install'); const program = require('commander'); const only = require('only'); - program .version(require('../package.json').version) .usage('[options] version') diff --git a/lib/install.js b/lib/install.js index 470a380..48659f2 100644 --- a/lib/install.js +++ b/lib/install.js @@ -1,7 +1,6 @@ 'use strict'; const path = require('path'); -const extend = require('extend'); const assert = require('assert'); const getNightlyVersion = require('./version').getNightlyVersion; const config = require('./config'); @@ -21,7 +20,10 @@ const DEFAULT_OPTIONS = { const TYPES = Object.keys(config); module.exports = async function install(options) { - options = extend({}, DEFAULT_OPTIONS, options); + options = { + ...DEFAULT_OPTIONS, + ...options, + }; const isChina = options.china || process.env.NODEINSTALL_CHINA; const result = getTypeAndVersion(options); const type = result.type; diff --git a/package.json b/package.json index 3bd0418..fde6211 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "bytes": "^2.5.0", "commander": "^2.9.0", "debug": "^2.6.6", - "extend": "^3.0.1", "node-nightly-version": "^1.0.6", "only": "^0.0.2", "progress": "^2.0.0",