Skip to content

Commit 57d9cc5

Browse files
committed
fix(config.ts): add default value for config parameter in OCO_OPENAI_API_KEY validator function
The OCO_OPENAI_API_KEY validator function now accepts an optional config parameter with a default value of an empty object {}. This change ensures that the function can be called without providing the config parameter, improving flexibility and avoiding potential errors when the parameter is not provided.
1 parent e599700 commit 57d9cc5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

out/cli.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21478,7 +21478,7 @@ var validateConfig = (key, condition, validationMessage) => {
2147821478
}
2147921479
};
2148021480
var configValidators = {
21481-
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config8) {
21481+
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config8 = {}) {
2148221482
validateConfig("OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */, value, "Cannot be empty");
2148321483
validateConfig(
2148421484
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,

out/github-action.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27900,7 +27900,7 @@ var validateConfig = (key, condition, validationMessage) => {
2790027900
}
2790127901
};
2790227902
var configValidators = {
27903-
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config7) {
27903+
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config7 = {}) {
2790427904
validateConfig("OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */, value, "Cannot be empty");
2790527905
validateConfig(
2790627906
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,

src/commands/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const validateConfig = (
4747
};
4848

4949
export const configValidators = {
50-
[CONFIG_KEYS.OCO_OPENAI_API_KEY](value: any, config?: any) {
50+
[CONFIG_KEYS.OCO_OPENAI_API_KEY](value: any, config: any = {}) {
5151
validateConfig(CONFIG_KEYS.OCO_OPENAI_API_KEY, value, 'Cannot be empty');
5252
validateConfig(
5353
CONFIG_KEYS.OCO_OPENAI_API_KEY,

0 commit comments

Comments
 (0)