Skip to content

SafetyCheckResult

Defined in: packages/engine/src/engine/ExpressionEngineSafety.ts:32

Whether input passed the safety bounds, and which one it failed.

optional error?: {
engineError?: EngineError;
error: string;
program: BytecodeProgram;
tokens: Token[];
value: Value;
};

Defined in: packages/engine/src/engine/ExpressionEngineSafety.ts:47

error.error (a plain string) exists purely because it’s spread directly into evaluateExpressionWithDiagnostic()’s own return shape ({value, tokens, program, error?: string, ...}), which deliberately keeps errors as display strings for the debug/diagnostic pipeline see that method’s own doc comment. error.engineError is additive (doesn’t replace the string field, so existing consumers of this exported type are unaffected): it carries the real EngineError this check constructed internally, so callers that DO want the original code/category/expected/found/suggestion (prepareExpression(), not the diagnostic pipeline) don’t have to reconstruct a generic one from just the flattened message.

optional engineError?: EngineError;
error: string;
program: BytecodeProgram;
tokens: Token[];
value: Value;

passed: boolean;

Defined in: packages/engine/src/engine/ExpressionEngineSafety.ts:33