diff options
author | Bert Belder <bertbelder@gmail.com> | 2018-11-15 20:07:40 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-11-16 12:07:40 +0800 |
commit | 48bf4062e4359674e1a417100eb76a6347e77fc1 (patch) | |
tree | e52f2c6c63a2afcdf2d5efc059e43c7f55f2c653 /js/util.ts | |
parent | 9b702da9e53b6efbc7a333380bcfb3d57733730e (diff) |
First pass at running subprocesses (#1156)
Diffstat (limited to 'js/util.ts')
-rw-r--r-- | js/util.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/js/util.ts b/js/util.ts index 9ba1d6346..c5197164e 100644 --- a/js/util.ts +++ b/js/util.ts @@ -131,3 +131,9 @@ const TypedArrayConstructor = Object.getPrototypeOf(Uint8Array); export function isTypedArray(x: unknown): x is TypedArray { return x instanceof TypedArrayConstructor; } + +// Returns whether o is an object, not null, and not a function. +// @internal +export function isObject(o: unknown): o is object { + return o != null && typeof o === "object"; +} |