@ffflorian/jszip-cli
Advanced tools
@@ -10,4 +10,3 @@ import { BuildService } from './BuildService.js'; | ||
| private readonly logger; | ||
| private options; | ||
| private readonly terminalOptions?; | ||
| private readonly options; | ||
| constructor(options?: TerminalOptions); | ||
@@ -14,0 +13,0 @@ /** |
+7
-11
@@ -17,3 +17,2 @@ import { cosmiconfigSync } from 'cosmiconfig'; | ||
| constructor(options) { | ||
| this.terminalOptions = options; | ||
| this.logger = logdown('jszip-cli/index', { | ||
@@ -24,6 +23,8 @@ logger: console, | ||
| this.configExplorer = cosmiconfigSync('jszip'); | ||
| this.options = { ...defaultOptions, ...this.terminalOptions }; | ||
| this.options = { ...defaultOptions, ...options }; | ||
| if (this.options.configFile) { | ||
| const configFileData = this.checkConfigFile(); | ||
| this.options = { ...defaultOptions, ...configFileData, ...options }; | ||
| } | ||
| this.logger.state.isEnabled = this.options.verbose; | ||
| this.logger.info('Merged options', this.options); | ||
| this.checkConfigFile(); | ||
| this.logger.info('Loaded options', this.options); | ||
@@ -94,6 +95,2 @@ this.buildService = new BuildService(this.options); | ||
| checkConfigFile() { | ||
| if (!this.options.configFile) { | ||
| this.logger.info('Not using any configuration file.'); | ||
| return; | ||
| } | ||
| let configResult = null; | ||
@@ -117,3 +114,3 @@ if (typeof this.options.configFile === 'string') { | ||
| if (!configResult || configResult.isEmpty) { | ||
| this.logger.info('Not using any configuration file.'); | ||
| this.logger.info('Configuration file not found or empty.'); | ||
| return; | ||
@@ -123,5 +120,4 @@ } | ||
| this.logger.info(`Using configuration file ${configResult.filepath}`); | ||
| this.options = { ...defaultOptions, ...configFileData, ...this.terminalOptions }; | ||
| this.logger.state.isEnabled = this.options.verbose; | ||
| return configFileData; | ||
| } | ||
| } |
+3
-3
@@ -22,3 +22,3 @@ { | ||
| "engines": { | ||
| "node": ">= 18.0" | ||
| "node": ">= 18" | ||
| }, | ||
@@ -46,4 +46,4 @@ "files": [ | ||
| "type": "module", | ||
| "version": "3.14.3", | ||
| "gitHead": "8c51af36ec3439ba37e2aaa27fe9ae1ef86f8d0b" | ||
| "version": "3.15.0", | ||
| "gitHead": "b968c846095113cbe57fbdd34e4593a4dea8a1c9" | ||
| } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
68141
-0.35%729
-0.68%3
50%