UNPKG

runtypes

Version:

Runtime validation for static types

8 lines (7 loc) 399 B
/** * Mimicking the behavior of type-level `` `${number}` ``. * * Note that `` `${NaN}` `` is not assignable to a variable of type `` `${number}` ``, but `` `${NaN as number}` `` is assignable, thus this function also accepts `"NaN"`. The same applies to `Infinity` and `-Infinity`. */ declare const isNumberLikeKey: (key: string | symbol) => key is `${number}`; export default isNumberLikeKey;