MCPcopy Create free account
hub / github.com/rolldown/rolldown / assertString

Function assertString

packages/rolldown/src/binding-magic-string.ts:16–18  ·  view source on GitHub ↗
(content: unknown, msg: string)

Source from the content-addressed store, hash-verified

14// Validate content type to match JS magic-string behavior.
15// napi-rs throws a generic Error on type mismatch, but JS magic-string throws TypeError.
16function assertString(content: unknown, msg: string): asserts content is string {
17 if (typeof content !== 'string') throw new TypeError(msg);
18}
19
20// Save native method refs before overriding.
21// eslint-disable-next-line @typescript-eslint/unbound-method

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…