Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function isErrorLike

    • Whether an unknown value should be rendered as an Error rather than JSON.

      A same-realm instanceof Error misses an Error created in another realm (iframe / jsdom test env / worker error surface — the same class of object data/loaders/abort-error.ts duck-types by name). Such an object stringifies to {} because name/message/stack are non-enumerable, so the console renderers drop its message unless they detect it structurally.

      Two realm-proof signals, neither of which fires on an ordinary { name, message } data object:

      • a genuine Error (isGenuineError: instance or [[Class]] brand, covering cross-realm Error and its subclasses);
      • failing that, the full string name + message + stack triple, which a plain data object almost never carries (covers a structured-clone / postMessage surface that is not an Error instance at all).

      Never throws — same rationale as the other helpers here.

      Parameters

      • value: unknown

      Returns boolean