assertProp()function
assertProp(obj: T, key: PropertyKey): asserts key is keyof T
| Param | Type | |
|---|---|---|
obj | T | The object to assert against. required |
key | PropertyKey | The key to assert is an own prop. required |
| Return | |
|---|---|
asserts key is keyof T |
| Throws | |
|---|---|
RequiredError | If key is not an own prop of obj. |
Assert that an unknown value is the key for an own prop of an object.