(key: string, value: unknown)
| 33 | } |
| 34 | |
| 35 | set(key: string, value: unknown): void { |
| 36 | const segments = key.split('.') |
| 37 | let cursor: Record<string, unknown> = this.state |
| 38 | |
| 39 | for (let index = 0; index < segments.length - 1; index += 1) { |
| 40 | const segment = segments[index] |
| 41 | const next = cursor[segment] |
| 42 | |
| 43 | if (!next || typeof next !== 'object') { |
| 44 | cursor[segment] = {} |
| 45 | } |
| 46 | |
| 47 | cursor = cursor[segment] as Record<string, unknown> |
| 48 | } |
| 49 | |
| 50 | cursor[segments[segments.length - 1]] = value |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | return { default: MockStore } |
no outgoing calls
no test coverage detected