source: node_modules/@reduxjs/toolkit/dist/uncheckedindexed.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 440 bytes
Line 
1// inlined from https://github.com/EskiMojo14/uncheckedindexed
2// relies on remaining as a TS file, not .d.ts
3type IfMaybeUndefined<T, True, False> = [undefined] extends [T] ? True : False
4
5const testAccess = ({} as Record<string, 0>)['a']
6
7export type IfUncheckedIndexedAccess<True, False> = IfMaybeUndefined<
8 typeof testAccess,
9 True,
10 False
11>
12
13export type UncheckedIndexedAccess<T> = IfUncheckedIndexedAccess<
14 T | undefined,
15 T
16>
Note: See TracBrowser for help on using the repository browser.