platform-bible-utils
    Preparing search index...

    Function evaluateWhenExpression

    • Experimental

      Evaluates a when-expression against the current context key values.

      Parameters

      • expression: string

        The when-expression to evaluate (parse results are memoized)

      • getContextKey: ContextKeyLookup

        Function that looks up the current value of a context key

      • templateVars: Record<string, undefined | string> = {}

        Values for {placeholder} segments in property references. A property reference containing a placeholder with no value evaluates to undefined (falsy)

      Returns boolean

      The boolean result of the expression. undefined, false, 0, and '' are falsy

      Error if the expression is not valid (use load-time validation to avoid this) This function is unstable and may change or disappear without notice