183 · Isomorphic core
Browser-safe and Node-safe validators.
Every method exists in every runtime. A guarded type that the host does not provide throws in strict mode and returns false in non-strict mode—never a missing-global ReferenceError.
11 · Core and extension methods
Build checks in the same style.
Unions
Accept one of several named validators.
JavaScript
is.union('type','string|number');
is.union(42,['string','number']);
// Spaces are trimmed. Custom and Node validators work.
nodeIs.union(Buffer.from('type'),'buffer|string');Validator names are resolved only from the strong-type prototype chain. Inherited Object methods such as
toString and multi-argument helper methods are rejected.18 · Node adapter
Node precision stays opt-in.
The adapter extends the same Is class. It imports only Node built-ins. The browser playground intentionally never loads it.
Node JavaScript
import IsNode from 'strong-type/node';
const is=new IsNode;
is.buffer(Buffer.from('type'));
is.proxy(new Proxy({},{}));
is.nodeReadable(process.stdin);Runtime labels
Stable methods. Guarded capabilities.
| Label | Availability | When unavailable |
|---|---|---|
| Shared | Standard JavaScript across supported Node and modern browsers. | Not normally applicable. |
| Guarded standard | A newer ECMAScript or Intl capability. | Strict throws TypeError; non-strict returns false. |
| Guarded Web API | A host API that may exist in browsers, workers, or newer Node versions. | Strict throws TypeError; non-strict returns false. |
| Node | Available only through strong-type/node. | The root import never loads Node built-ins. |
object(null) remains true because JavaScript reports typeof null === 'object'. Use nonNullObject for the common non-null meaning.