Function createExpression
- createExpression(
expression: unknown,
propertySpec?: StylePropertySpecification | null,
globalState?: Record<string, any>,
): Result<StyleExpression, ExpressionParsingError[]>Parameters
- expression: unknown
OptionalpropertySpec: StylePropertySpecification | nullOptionalglobalState: Record<string, any>
Returns Result<StyleExpression, ExpressionParsingError[]>
Was this helpful?
Parse and typecheck the given style spec JSON expression. If options.defaultValue is provided, then the resulting StyleExpression's
evaluate()method will handle errors by logging a warning (once per message) and returning the default value. Otherwise, it will throw evaluation errors.