ts-data-forge
    Preparing search index...
    • Type guard for the Err variant.

      Type Parameters

      • R extends UnknownTernaryResult

      Parameters

      • result: R

      Returns result is NarrowToErr<R>

      const maybeErr = TernaryResult.err('boom') as TernaryResult<
      number,
      string,
      string
      >;

      if (TernaryResult.isErr(maybeErr)) {
      assert.strictEqual(maybeErr.value, 'boom');
      }