( map: Map<string, V>, key: string, errorMessage: string )
| 58 | } |
| 59 | |
| 60 | export function mapGetOrThrow<V extends {}>( |
| 61 | map: Map<string, V>, |
| 62 | key: string, |
| 63 | errorMessage: string |
| 64 | ): V { |
| 65 | const value = map.get(key); |
| 66 | if (value === undefined) { |
| 67 | throw new Error(errorMessage); |
| 68 | } |
| 69 | return value; |
| 70 | } |
| 71 | |
| 72 | export function mapGetOrThrowInternal<V extends {}>( |
| 73 | map: Map<string, V>, |
no outgoing calls
no test coverage detected