From 1a9fdacd2d1207f83bc5ac662024274d6b20b1a3 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 10 Sep 2021 00:12:29 +0700 Subject: [PATCH] Update index.ts --- source/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;