export function formulaBindingErrorMessage(message, cause) {
    return cause instanceof Error && cause.message.length > 0 ? cause.message : message;
}
function canUseDirectOnlyRuntimeProgram(compiled, directScalar) {
    return directScalar !== undefined && !compiled.volatile && !compiled.producesSpill;
}
export function makeUnmanagedCompiledPlan(source, compiled, templateId) {
    return {
        id: 0,
        source,
        compiled,
        ...(templateId !== undefined ? { templateId } : {}),
    };
}
export function canRetainUnmanagedCompiledPlan(existingPlanId, compiled, directScalar) {
    return existingPlanId === 0 && canUseDirectOnlyRuntimeProgram(compiled, directScalar);
}
//# sourceMappingURL=formula-binding-plan-helpers.js.map