---
title: "isNodeValue(): function in IR, TypeShade API reference"
description: "isNodeValue, a function in IR. Runtime type guard for \"is this value a node\"."
url: https://typeshade.dev/api/isnodevalue/
language: en
---

# `isNodeValue()`

Function in IR

Runtime type guard for "is this value a node".

`import { isNodeValue } from 'typeshade/core/ir'`

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

## Syntax

```ts
const isNodeValue: (v: unknown) => v is ReadonlyNode
```

## Parameters

**`v` `unknown`**

## Return value

`v is ReadonlyNode`

## Description

Runtime type guard for “is this value a node”. It reads the [`NODE_BRAND`](https://typeshade.dev/api/nodebrand/) slot instead of using `instanceof Node`, so it also recognizes a node built by a different loaded copy of this package, which `instanceof` would miss because a dual-loaded dependency splits prototype identity. Use it over `instanceof` anywhere a value may come from another copy.

## Examples

### Example

```ts
import { isNodeValue, f32 } from 'typeshade/core/ir'

isNodeValue(f32(1))  // true
isNodeValue(42)      // false: a bare number is not a node
```

## See also

- [`NODE_BRAND`](https://typeshade.dev/api/nodebrand/)

## Source

[`src/core/ir/node.ts`, line 130](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L130), at commit af54ddad5
