Expand description
Node util.types — runtime type-tag predicates.
Every function here answers “what internal kind is this value?” without any
user-observable coercion, mirroring Node’s require('node:util/types'). Each
predicate inspects the argument’s JsObj heap variant or its hidden
@@native tag and returns a plain boolean, so classification reuses the exact
machinery the rest of the runtime already relies on:
Map/Setcarry aweakflag → the weak/non-weak split;RegExp/Promise/Generatorare first-class heap variants;Date/ArrayBuffer/TypedArray/Bufferare plain objects wearing a@@nativetag (seedate.rs/typedarray.rs/buffer.rs);- async/generator functions are read off the shared
FuncDefflags; isNativeErrordefers to the realhost::instance_ofagainstError.
Deviations from V8, kept honest (node-js is not V8):
isProxyis alwaysfalse— there is noProxyin node-js.- No boxed primitives exist (
Number(x)yields a primitive, never an object wrapper), soisBoxedPrimitiveand theis{Number,String,…}Objectfamily are allfalse. isArgumentsObjectisfalse:argumentsis materialised as a plain array (seehost.rs), indistinguishable from any other array here.- No
SharedArrayBuffer/DataView/BigInt64Array, module-namespace, or external objects → those predicates arefalse.