Skip to content

Commit

Permalink
Merge pull request #59 from mondaycom/maorba/fix/fix_false_key_value_…
Browse files Browse the repository at this point in the history
…check

fix: falsey check for values retrieved for envs and secrets
  • Loading branch information
maorb-dev authored May 7, 2024
2 parents 3a38282 + 4dcc5d6 commit a741a33
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/key-value-manager/key-value-manager.abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ export abstract class KeyValueManager {
return Object.keys(this.cachedData);
}

get(key: string, options?: GetOptions): JsonValue {
get(key: string, options?: GetOptions): JsonValue | undefined {
this.initDataIfNeeded(options);
if (!isDefined(this.cachedData)) {
this.logger.error(`[${this.tag}.get] There is an issue with loading data for key`, { mondayInternal: false });
return null;
}

return this.cachedData[key] || process.env[key] as JsonValue;
return this.cachedData[key] !== undefined ? this.cachedData[key] : process.env[key];
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/minimal-package.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default { name: '@mondaycom/apps-sdk', version: '3.0.5' };
export default { name: '@mondaycom/apps-sdk', version: '3.0.6' };
2 changes: 1 addition & 1 deletion lib/types/key-value-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export type KeyValueData = Record<string, JsonValue>
export type IKeyValueManager = {
getKeys(_options?: GetOptions): Array<string>;

get(_key: string, _options?: GetOptions): JsonValue;
get(_key: string, _options?: GetOptions): JsonValue | undefined;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mondaycom/apps-sdk",
"version": "3.0.5",
"version": "3.0.6",
"description": "monday apps SDK for NodeJS",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down

0 comments on commit a741a33

Please sign in to comment.