Skip to content

Commit 6c09563

Browse files
authored
fix: update return type for check is primitive (#15770)
1 parent 17196e1 commit 6c09563

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/jest-get-type/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ export function getType(value: unknown): ValueType {
5858
throw new Error(`value of unknown type: ${value}`);
5959
}
6060

61-
export const isPrimitive = (value: unknown): boolean => Object(value) !== value;
61+
export const isPrimitive = (
62+
value: unknown,
63+
): value is null | undefined | string | number | boolean | symbol | bigint =>
64+
Object(value) !== value;

0 commit comments

Comments
 (0)