mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 22:14:29 +09:00
13 lines
415 B
TypeScript
13 lines
415 B
TypeScript
import { lintExpression } from "@webstudio-is/sdk";
|
|
|
|
export const getExpressionErrorMessages = (
|
|
options: Parameters<typeof lintExpression>[0]
|
|
) =>
|
|
lintExpression(options)
|
|
.filter((diagnostic) => diagnostic.severity === "error")
|
|
.map((diagnostic) => diagnostic.message);
|
|
|
|
export const hasExpressionDiagnostics = (
|
|
options: Parameters<typeof lintExpression>[0]
|
|
) => lintExpression(options).length > 0;
|