UIElement Docs Version 0.13.3

🔗 Function: asJSON()

asJSON<T>(fallback): AttributeParser<T>

Defined in: src/lib/parsers.ts:101

Parse an attribute as a JSON serialized object with a fallback

🔗 Type Parameters

🔗 T

T extends object

🔗 Parameters

🔗 fallback

T

fallback value

🔗 Returns

AttributeParser<T>

parser function

🔗 Since

0.11.0

🔗 Throws

if the value and fallback are both null or undefined

🔗 Throws

if the value is not a valid JSON object