# Function unwrapOr

Core exports - Types, Result<T,E>, errors, and logger Split from index.ts for file size compliance (Issue #285)

- unwrapOr<T, E>(result: Result<T, E>, defaultValue: T): T

  Extracts the success value from a Result, or returns a default value.

  #### Type Parameters

  - T

    The success value type

  - E

    The error value type

  #### Parameters

  - result: Result<T, E>

    The Result to unwrap

  - defaultValue: T

    The default value to return if Err

  #### Returns T

  The success value or the default value

  #### Example

      const result = err(new Error('failed'));
      const value = unwrapOr(result, 'fallback');
      console.log(value); // "fallback"

  - Defined in packages/nexus-agents/src/core/result.ts:144