diff --git a/source/index.ts b/source/index.ts index 82822b0..aab38cc 100644 --- a/source/index.ts +++ b/source/index.ts @@ -359,7 +359,10 @@ is.nonEmptySet = (value: unknown): value is Set => is.set(value) is.emptyMap = (value: unknown): value is Map => is.map(value) && value.size === 0; is.nonEmptyMap = (value: unknown): value is Map => 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`.) */ + +/** +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;