assertDictionaryItem()function
assertDictionaryItem(dict: ImmutableDictionary<T>, key: string, caller: AnyCaller = assertDictionaryItem): asserts key is string
| Param | Type | |
|---|---|---|
dict | ImmutableDictionary<T> | The dictionary to assert against. required |
key | string | The key to assert is an own prop. required |
caller | AnyCaller | Function to attribute a thrown error to (defaults to assertDictionaryItem itself). Defaults to assertDictionaryItem |
| Return | |
|---|---|
asserts key is string |
| Throws | |
|---|---|
RequiredError | If key is not an own prop of dict. |
Assert that an unknown value is the key for an own prop of a dictionary.