(key?: string)
| 19 | } |
| 20 | |
| 21 | get(key?: string): unknown { |
| 22 | if (!key) { |
| 23 | return this.state |
| 24 | } |
| 25 | |
| 26 | return key.split('.').reduce<unknown>((acc, segment) => { |
| 27 | if (!acc || typeof acc !== 'object') { |
| 28 | return undefined |
| 29 | } |
| 30 | |
| 31 | return (acc as Record<string, unknown>)[segment] |
| 32 | }, this.state) |
| 33 | } |
| 34 | |
| 35 | set(key: string, value: unknown): void { |
| 36 | const segments = key.split('.') |
no outgoing calls
no test coverage detected