@nu-art/commando 0.400.13 → 0.401.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.
|
@@ -30,7 +30,11 @@ export class CLIParamsResolver {
|
|
|
30
30
|
const keyName = cliParamToResolve.keyName;
|
|
31
31
|
if (exists(cliParamToResolve.dependencies))
|
|
32
32
|
cliParamToResolve.dependencies?.forEach(dependency => {
|
|
33
|
-
|
|
33
|
+
// If dependency value is a function, call it with the current param's processed value
|
|
34
|
+
const dependencyValue = typeof dependency.value === 'function'
|
|
35
|
+
? dependency.value(finalValue)
|
|
36
|
+
: dependency.value;
|
|
37
|
+
output[dependency.param.keyName] = dependencyValue;
|
|
34
38
|
});
|
|
35
39
|
if (cliParamToResolve.isArray) {
|
|
36
40
|
let currentValues = output[keyName];
|
package/cli-params/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type CliParams<T extends BaseCliParam<string, any>[]> = {
|
|
|
6
6
|
};
|
|
7
7
|
export type DependencyParam<T extends Primitive | Primitive[]> = {
|
|
8
8
|
param: BaseCliParam<string, T>;
|
|
9
|
-
value: T;
|
|
9
|
+
value: T | ((currentValue: any) => T);
|
|
10
10
|
};
|
|
11
11
|
export type BaseCliParam<K extends string, V extends Primitive | Primitive[]> = {
|
|
12
12
|
keys: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/commando",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.401.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build": "tsc"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nu-art/ts-common": "0.
|
|
32
|
+
"@nu-art/ts-common": "0.401.0"
|
|
33
33
|
},
|
|
34
34
|
"unitConfig": {
|
|
35
35
|
"type": "typescript-lib"
|