Debian Codegraph @

install/freeipa-webui/node_modules/@reduxjs/toolkit/dist/uncheckedindexed.ts

raw
1 // inlined from https://github.com/EskiMojo14/uncheckedindexed
2 // relies on remaining as a TS file, not .d.ts
3 type IfMaybeUndefined<T, True, False> = [undefined] extends [T] ? True : False
4
5 const testAccess = ({} as Record<string, 0>)['a']
6
7 export type IfUncheckedIndexedAccess<True, False> = IfMaybeUndefined<
8 typeof testAccess,
9 True,
10 False
11 >
12
13 export type UncheckedIndexedAccess<T> = IfUncheckedIndexedAccess<
14 T | undefined,
15 T
16 >