@iobroker/js-controller-common 4.0.9 → 4.0.12
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/lib/common/tools.js +10 -6
- package/package.json +2 -2
package/lib/common/tools.js
CHANGED
|
@@ -1569,6 +1569,7 @@ async function uninstallNodeModule(packageName, options = {}) {
|
|
|
1569
1569
|
* @typedef {object} RebuildNodeModulesOptions
|
|
1570
1570
|
* @property {boolean} [debug] Whether to include `stderr` in the output and increase the loglevel to include more than errors
|
|
1571
1571
|
* @property {string} [cwd] Which directory to work in. If none is given, this defaults to ioBroker's root directory.
|
|
1572
|
+
* @property {string} [module] single module which needs rebuild, can contain version too like module@version
|
|
1572
1573
|
*/
|
|
1573
1574
|
|
|
1574
1575
|
/**
|
|
@@ -1596,7 +1597,7 @@ async function rebuildNodeModules(options = {}) {
|
|
|
1596
1597
|
pipeLinewise(stdout, process.stdout);
|
|
1597
1598
|
}
|
|
1598
1599
|
|
|
1599
|
-
return pak.rebuild();
|
|
1600
|
+
return pak.rebuild(options.module ? [options.module] : undefined);
|
|
1600
1601
|
}
|
|
1601
1602
|
|
|
1602
1603
|
/**
|
|
@@ -2834,7 +2835,7 @@ function validateGeneralObjectProperties(obj, extend) {
|
|
|
2834
2835
|
|
|
2835
2836
|
// common.states needs to be a real object or an array
|
|
2836
2837
|
if (
|
|
2837
|
-
obj.common.states !== null &&
|
|
2838
|
+
obj.common.states !== null && // we allow null for deletion TODO: implement https://github.com/ioBroker/ioBroker.js-controller/issues/1735
|
|
2838
2839
|
obj.common.states !== undefined &&
|
|
2839
2840
|
!isObject(obj.common.states) &&
|
|
2840
2841
|
!Array.isArray(obj.common.states)
|
|
@@ -2842,9 +2843,6 @@ function validateGeneralObjectProperties(obj, extend) {
|
|
|
2842
2843
|
throw new Error(
|
|
2843
2844
|
`obj.common.states has an invalid type! Expected "object", received "${typeof obj.common.states}"`
|
|
2844
2845
|
);
|
|
2845
|
-
} else if (obj.common.states === null && !extend) {
|
|
2846
|
-
// extend only allowed on extend
|
|
2847
|
-
throw new Error(`obj.common.states has an invalid type! Expected non-null "object", received "null"`);
|
|
2848
2846
|
}
|
|
2849
2847
|
}
|
|
2850
2848
|
|
|
@@ -3001,7 +2999,13 @@ function pipeLinewise(input, output) {
|
|
|
3001
2999
|
input,
|
|
3002
3000
|
crlfDelay: Infinity
|
|
3003
3001
|
});
|
|
3004
|
-
rl.on('line', line =>
|
|
3002
|
+
rl.on('line', line => {
|
|
3003
|
+
try {
|
|
3004
|
+
output.write(line + os.EOL);
|
|
3005
|
+
} catch {
|
|
3006
|
+
// ignore
|
|
3007
|
+
}
|
|
3008
|
+
});
|
|
3005
3009
|
rl.on('error', () => {}); // Ignore errors
|
|
3006
3010
|
}
|
|
3007
3011
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/js-controller-common",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.12",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"lib/",
|
|
48
48
|
"index.js"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "8d84f8138adacae4b60d05dd0f34fde8c36546dc"
|
|
51
51
|
}
|