NODE_BRAND
On this page

NODE_BRAND

Constant in IR

The symbol every node carries as a brand, installed once on the ReadonlyNode prototype.

import { NODE_BRAND } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const NODE_BRAND: typeof NODE_BRAND

Description

The symbol every node carries as a brand, installed once on the ReadonlyNode prototype. It is created with Symbol.for, which resolves through the global symbol registry, so when a bundler loads two copies of this package a node built by one copy still carries the brand the other copy checks for. instanceof Node gives no such guarantee, because prototype identity differs per copy. isNodeValue reads this slot.

See also

Source

src/core/ir/node.ts, line 151, at commit 26de7be8

Edit this page Report a problem