attrString

Returns an attribute's value as a trimmed string, or null when it is absent, empty or not a string.

@internote/canvas-sdkFunction
On this page
import { attrString } from '@internote/canvas-sdk';

A binding, a refined value and a keyframe track are not strings and read as null. This is how the semantic pass reads an attribute it needs the written text of, and a validate hook reads one the same way.

#Signature

(node: NodeLike, identifier: string): string | null

#Parameters

node
The node to read.
identifier
The attribute's canonical name.

Declared in packages/canvas-sdk/src/environment/node-attributes.ts:81.

Last updated