node-confmanager 1.8.1 → 1.8.2

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.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022, Sébastien Vidal
1
+ Copyright (c) 2023, Sébastien Vidal
2
2
 
3
3
  Permission to use, copy, modify, and/or distribute this software for any
4
4
  purpose with or without fee is hereby granted, provided that the above
@@ -67,10 +67,7 @@ class ConfManager extends NodeContainerPattern {
67
67
  // array
68
68
  else if (this.skeletons[key] && "array" === this.skeletons[key]) {
69
69
  const nextArgs = args.slice(i + 1, args.length);
70
- if (!nextArgs.length) {
71
- this.set(key, []);
72
- }
73
- else {
70
+ if (nextArgs.length) {
74
71
  const endArrayArgs = nextArgs.findIndex((a) => {
75
72
  return a.startsWith("--") ||
76
73
  (a.startsWith("-") && !!this.shortcuts[a.slice(1)]);
@@ -126,7 +123,7 @@ class ConfManager extends NodeContainerPattern {
126
123
  }
127
124
  }
128
125
  else {
129
- return (0, promises_1.readFile)(this.filePath, "utf8").then((content) => {
126
+ return (0, promises_1.readFile)(this.filePath, "utf-8").then((content) => {
130
127
  return JSON.parse(content);
131
128
  }).then((data) => {
132
129
  for (const key in data) {
@@ -149,8 +146,8 @@ class ConfManager extends NodeContainerPattern {
149
146
  objects[key] = value;
150
147
  });
151
148
  return this.spaces ?
152
- (0, promises_1.writeFile)(this.filePath, JSON.stringify(objects, undefined, 2), "utf8") :
153
- (0, promises_1.writeFile)(this.filePath, JSON.stringify(objects), "utf8");
149
+ (0, promises_1.writeFile)(this.filePath, JSON.stringify(objects, undefined, 2), "utf-8") :
150
+ (0, promises_1.writeFile)(this.filePath, JSON.stringify(objects), "utf-8");
154
151
  });
155
152
  }
156
153
  // bind a shortcut for commandline
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
+
2
3
  "name": "node-confmanager",
3
- "version": "1.8.1",
4
+ "version": "1.8.2",
4
5
  "description": "A configuration manager",
5
6
 
6
7
  "type": "commonjs",
@@ -18,7 +19,7 @@
18
19
 
19
20
  "scripts": {
20
21
 
21
- "build": "npx tsc --project \"./tsconfig.json\"",
22
+ "build": "node ./removeOldBuild.js && npx tsc --project \"./tsconfig.json\"",
22
23
 
23
24
  "lint": "npx eslint ./test/**/*.js",
24
25
  "check-requires": "npx used-deps-analyzer \"./package.json\" \"./src\" --no-dev --overkill \"fs-extra\" \"node-promfs\"",
@@ -33,16 +34,31 @@
33
34
  "files": [
34
35
  "/lib"
35
36
  ],
37
+ "engines": {
38
+ "node": ">=16.0.0"
39
+ },
40
+
41
+ "dependencies": {
42
+ "node-containerpattern": "1.7.6"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "20.8.2",
46
+ "check-version-modules": "2.0.0",
47
+ "coveralls": "3.1.1",
48
+ "eslint": "8.50.0",
49
+ "husky": "8.0.3",
50
+ "mocha": "10.2.0",
51
+ "nyc": "15.1.0",
52
+ "typescript": "5.2.2",
53
+ "used-deps-analyzer": "0.1.8"
54
+ },
55
+ "optionalDependencies": {},
36
56
 
37
57
  "husky": {
38
58
  "hooks": {
39
59
  "pre-push": "npm run-script tests"
40
60
  }
41
61
  },
42
- "repository": {
43
- "type": "git",
44
- "url": "git://github.com/Psychopoulet/node-confmanager.git"
45
- },
46
62
  "keywords": [
47
63
  "node",
48
64
  "conf",
@@ -60,25 +76,14 @@
60
76
  ],
61
77
  "author": "Sébastien VIDAL",
62
78
  "license": "ISC",
79
+
80
+ "homepage": "https://github.com/Psychopoulet/node-confmanager#readme",
81
+ "repository": {
82
+ "type": "git",
83
+ "url": "git://github.com/Psychopoulet/node-confmanager.git"
84
+ },
63
85
  "bugs": {
64
86
  "url": "https://github.com/Psychopoulet/node-confmanager/issues"
65
- },
66
- "dependencies": {
67
- "node-containerpattern": "1.7.5"
68
- },
69
- "devDependencies": {
70
- "@types/node": "20.5.0",
71
- "check-version-modules": "1.3.5",
72
- "coveralls": "3.1.1",
73
- "eslint": "8.47.0",
74
- "husky": "8.0.3",
75
- "mocha": "10.2.0",
76
- "nyc": "15.1.0",
77
- "typescript": "5.1.6",
78
- "used-deps-analyzer": "0.1.2"
79
- },
80
- "homepage": "https://github.com/Psychopoulet/node-confmanager#readme",
81
- "engines": {
82
- "node": ">=16.0.0"
83
87
  }
88
+
84
89
  }