simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

[micro-dash] Typing for `omit` with nullable param #78

Closed ersimont closed 2 years ago

ersimont commented 2 years ago

Typing looks like omit() can accept a possibly-null object, but that makes the list of keys throw a typing error.

omit({} as Record<string, any>, 'hi'); // no error
omit({} as Record<string, any> | null, 'hi'); // error!