doc: is.properyKey
This commit is contained in:
parent
b8922dd378
commit
07ba63da4f
2 changed files with 5 additions and 0 deletions
|
|
@ -428,6 +428,10 @@ Returns `true` if `value` is an even integer.
|
|||
|
||||
Returns `true` if `value` is an odd integer.
|
||||
|
||||
##### .propertyKey(value)
|
||||
|
||||
Returns `true` if `value` can be used as an object property key (either `string`, `number` or `symbol`.)
|
||||
|
||||
##### .any(predicate | predicate[], ...values)
|
||||
|
||||
Using a single `predicate` argument, returns `true` if **any** of the input `values` returns true in the `predicate`:
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ is.nonEmptySet = <T = unknown>(value: unknown): value is Set<T> => is.set(value)
|
|||
|
||||
is.emptyMap = (value: unknown): value is Map<never, never> => is.map(value) && value.size === 0;
|
||||
is.nonEmptyMap = <Key = unknown, Value = unknown>(value: unknown): value is Map<Key, Value> => is.map(value) && value.size > 0;
|
||||
/** Returns `true` if `value` can be used as an object property key (either a `string`, a `number` or a `symbol`.) */
|
||||
is.propertyKey = (value: unknown): value is PropertyKey => is.any([is.string, is.number, is.symbol], value);
|
||||
|
||||
export type Predicate = (value: unknown) => boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue