Library API
    Preparing search index...

    Function evaluateString

    • Evaluates a value or invokes a function with the provided arguments, stringifying the result.

      Type Parameters

      • A extends any[] = any[]

      Parameters

      • val: unknown

        A value or function to evaluate

      • ...args: A

        Arguments forwarded to the function if val is callable

      Returns string

      The stringified result

      evaluateString('test'); // 'test'
      evaluateString((locale?: string) => locale === 'fr' ? 'Sud' : 'South', 'fr'); // 'Sud'