From 1883a304fc1449b403e223c8b7dde505f9a68fa2 Mon Sep 17 00:00:00 2001 From: lijialiang Date: Fri, 12 Aug 2022 14:35:37 +0800 Subject: [PATCH 1/3] fix: detectiveConfig.includeCore doesn't work. --- index.js | 1 - lib/config.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 7c59af9..9ba6607 100644 --- a/index.js +++ b/index.js @@ -82,7 +82,6 @@ module.exports.toList = function(options = {}) { */ module.exports._getDependencies = function(config = {}) { const precinctOptions = config.detectiveConfig; - precinctOptions.includeCore = false; let dependencies; try { diff --git a/lib/config.js b/lib/config.js index 7c8b6c3..cd23ae6 100644 --- a/lib/config.js +++ b/lib/config.js @@ -16,7 +16,7 @@ module.exports = class Config { this.requireConfig = options.config || options.requireConfig; this.webpackConfig = options.webpackConfig; this.nodeModulesConfig = options.nodeModulesConfig; - this.detectiveConfig = options.detective || options.detectiveConfig || {}; + this.detectiveConfig = options.detective || options.detectiveConfig || { includeCore: false }; this.tsConfig = options.tsConfig; this.noTypeDefinitions = options.noTypeDefinitions; From 2b998a41d69cab6efe3b51d7f12086671514fcb1 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 9 May 2023 15:28:12 +0300 Subject: [PATCH 2/3] Update index.js --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 9ba6607..34c82e7 100644 --- a/index.js +++ b/index.js @@ -81,11 +81,10 @@ module.exports.toList = function(options = {}) { * @return {Array} */ module.exports._getDependencies = function(config = {}) { - const precinctOptions = config.detectiveConfig; let dependencies; try { - dependencies = precinct.paperwork(config.filename, precinctOptions); + dependencies = precinct.paperwork(config.filename, config.detectiveConfig); debug(`extracted ${dependencies.length} dependencies: `, dependencies); } catch (error) { debug(`error getting dependencies: ${error.message}`); From 2a72eae49a49afd7e48dd0e43fdf8335a173b3a1 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 9 May 2023 15:30:01 +0300 Subject: [PATCH 3/3] Update config.js --- lib/config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index cd23ae6..327f730 100644 --- a/lib/config.js +++ b/lib/config.js @@ -19,7 +19,6 @@ module.exports = class Config { this.detectiveConfig = options.detective || options.detectiveConfig || { includeCore: false }; this.tsConfig = options.tsConfig; this.noTypeDefinitions = options.noTypeDefinitions; - this.filter = options.filter; if (!this.filename) throw new Error('filename not given');