Skip to content

Commit 3be502b

Browse files
committed
chore: add docs and @internal for booleanSelector
1 parent a8739fd commit 3be502b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/node-config-provider/src/booleanSelector.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ export enum SelectorType {
33
CONFIG = "shared config entry",
44
}
55

6+
/**
7+
* Returns boolean value true/false for string value "true"/"false",
8+
* if the string is defined in obj[key]
9+
* Returns undefined, if obj[key] is not defined.
10+
* Throws error for all other cases.
11+
*
12+
* @internal
13+
*/
614
export const booleanSelector = (obj: { [key: string]: string }, key: string, type: SelectorType) => {
715
if (!(key in obj)) return undefined;
816
if (obj[key] === "true") return true;

0 commit comments

Comments
 (0)