We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8739fd commit 3be502bCopy full SHA for 3be502b
packages/node-config-provider/src/booleanSelector.ts
@@ -3,6 +3,14 @@ export enum SelectorType {
3
CONFIG = "shared config entry",
4
}
5
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
+ */
14
export const booleanSelector = (obj: { [key: string]: string }, key: string, type: SelectorType) => {
15
if (!(key in obj)) return undefined;
16
if (obj[key] === "true") return true;
0 commit comments