@ntlab/sipd-agr 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,16 +103,23 @@ class Configuration {
103
103
  }
104
104
 
105
105
  checkDefaults() {
106
+ /**
107
+ * Option value priority (from higher to lower):
108
+ * 1. Command line argument
109
+ * 2. Configuration file
110
+ * 3. Default value
111
+ */
106
112
  for (const [k, v] of Object.entries(this.defaults)) {
107
113
  const opt = Array.isArray(v) ? v[0] : k;
108
114
  const defval = Array.isArray(v) ? v[1] : v;
109
- // get value from command options
110
- let value = Cmd.get(opt);
111
- // fallback to default
112
- if (value === null) {
113
- value = defval;
115
+ // use value from configuration file or default value
116
+ let value = this[k] !== undefined ? this[k] : defval;
117
+ // override if command line argument exist
118
+ let optvalue = Cmd.get(opt);
119
+ if (optvalue !== undefined && optvalue !== null) {
120
+ value = optvalue;
114
121
  }
115
- if (value !== undefined && value !== null) {
122
+ if (this[k] !== value) {
116
123
  this[k] = value;
117
124
  }
118
125
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@ntlab/sipd-agr",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "SIPD RI Kemendagri Automation is a web automation using Selenium to help manage data such as budgeting download",
5
5
  "main": "main.js",
6
6
  "author": "Toha <tohenk@yahoo.com>",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@ntlab/ntlib": "^2.6.2",
10
- "@ntlab/webrobot": "^2.1.2",
11
- "@ntlab/work": "^2.3.0",
9
+ "@ntlab/ntlib": "^2.7.0",
10
+ "@ntlab/webrobot": "^2.5.3",
11
+ "@ntlab/work": "^2.5.0",
12
12
  "debug": "^4.4.3",
13
13
  "exceljs": "^4.4.0",
14
14
  "glob": "^11.0.3"