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 bfa607a commit 7f3c4f5Copy full SHA for 7f3c4f5
src/Shared/Helpers.tsx
@@ -103,3 +103,12 @@ export const getWebhookEventIcon = (eventName: WebhookEventNameType) => {
103
}
104
105
export const isNullOrUndefined = (value: unknown): boolean => value === null || value === undefined
106
+
107
+export const getKeyToBooleanMapFromArray = <T extends string | number>(arr: T[] = []) =>
108
+ arr.reduce<Record<T, boolean>>(
109
+ (acc, key) => {
110
+ acc[key] = true
111
+ return acc
112
+ },
113
+ {} as Record<T, boolean>,
114
+ )
0 commit comments