@nevware21/tripwire - v0.1.2
    Preparing search index...

    Interface IScopeContextOverrides

    Provides optional overrides for the default behavior of the context

    interface IScopeContextOverrides {
        eval?: (
            parent: IScopeContext,
            expr: boolean,
            evalMsg?: MsgSource,
        ) => boolean;
        fail?: (
            parent: IScopeContext,
            msg: string,
            details: any,
            causedBy: Error,
        ) => void;
        getDetails?: (parent: IScopeContext) => any;
        getEvalMessage?: (parent: IScopeContext, evalMsg: MsgSource) => string;
        getMessage?: (parent: IScopeContext, evalMsg?: MsgSource) => string;
    }
    Index

    Properties

    eval?: (parent: IScopeContext, expr: boolean, evalMsg?: MsgSource) => boolean

    This evaluates the result and if it fails, it throws an error

    Type declaration

      • (parent: IScopeContext, expr: boolean, evalMsg?: MsgSource): boolean
      • Parameters

        • parent: IScopeContext

          The parent context

        • expr: boolean

          The expression to evaluate

        • OptionalevalMsg: MsgSource

          The default message to display

        Returns boolean

        The result of the evaluation

    fail?: (
        parent: IScopeContext,
        msg: string,
        details: any,
        causedBy: Error,
    ) => void

    Throws an AssertionFailure with the given message.

    Type declaration

      • (parent: IScopeContext, msg: string, details: any, causedBy: Error): void
      • Parameters

        • parent: IScopeContext
        • msg: string

          The message to display.

        • details: any

          The details (props) to include in the error

        • causedBy: Error

        Returns void

    AssertionError

    getDetails?: (parent: IScopeContext) => any

    Returns the details of the evaluation

    Type declaration

    getEvalMessage?: (parent: IScopeContext, evalMsg: MsgSource) => string

    Resolves and returns only the eval message to be displayed for the evaluation, this does not include the value or the scope initMsg or any other details.

    Type declaration

    getMessage?: (parent: IScopeContext, evalMsg?: MsgSource) => string

    Returns the message to be displayed for the evaluation

    Type declaration

      • (parent: IScopeContext, evalMsg?: MsgSource): string
      • Parameters

        Returns string

        The message to be displayed for the evaluation