diff options
Diffstat (limited to 'std/node/util.ts')
-rw-r--r-- | std/node/util.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/std/node/util.ts b/std/node/util.ts index 9879da513..73cbbf823 100644 --- a/std/node/util.ts +++ b/std/node/util.ts @@ -46,6 +46,12 @@ export function isRegExp(value: unknown): boolean { return value instanceof RegExp; } +export function isPrimitive(value: unknown): boolean { + return ( + value === null || (typeof value !== "object" && typeof value !== "function") + ); +} + export function validateIntegerRange( value: number, name: string, |