stringAttr
Returns an attribute as a string, or the fallback when it is absent or anything else. The string is not trimmed.
@internote/canvas-sdkOn this page
import { stringAttr } from '@internote/canvas-sdk';#Signature
(
attrs: Readonly<Record<string, unknown>>,
identifier: string,
fallback: string,
): string
(
attrs: Readonly<Record<string, unknown>>,
identifier: string,
): string | undefined#Parameters
attrsAn attribute map, such as
ctx.animation.attrValuesOf(node).identifierThe attribute's canonical name.
fallbackWhat to return when the attribute is not a string.
Declared in packages/canvas-sdk/src/environment/node-attributes.ts:117.