MCPcopy Create free account
hub / github.com/babel/babel / assertNode

Function assertNode

packages/babel-types/src/asserts/assertNode.ts:4–9  ·  view source on GitHub ↗
(node?: any)

Source from the content-addressed store, hash-verified

2import type * as t from "../index.ts";
3
4export default function assertNode(node?: any): asserts node is t.Node {
5 if (!isNode(node)) {
6 const type = node?.type ?? JSON.stringify(node);
7 throw new TypeError(`Not a valid node of type "${type}"`);
8 }
9}

Callers

nothing calls this directly

Calls 1

isNodeFunction · 0.85

Tested by

no test coverage detected