( ...inputs: Array<Interval | IntervalResult> )
| 202 | if (result.kind === 'singular') return result.value; |
| 203 | return undefined; |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Unwrap an interval from either a plain Interval or an IntervalResult. |
| 208 | * |
| 209 | * Used by arithmetic operations to accept both formats for convenience. |
| 210 | * Returns undefined if the input is an IntervalResult without an enclosure |
| 211 | * (empty, entire, or a pole). |
| 212 | */ |
| 213 | export function unwrap(input: Interval | IntervalResult): Interval | undefined { |
| 214 | // Check if it's an IntervalResult |
| 215 | if ('kind' in input) return getValue(input); |
| 216 | // Plain interval |
| 217 | return input; |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Unwrap and propagate errors from IntervalResult inputs. |
| 222 | * |
| 223 | * If any input has no enclosure (empty, entire, or a pole), returns that |
| 224 | * result. Otherwise returns the unwrapped intervals. A finite jump (a |
| 225 | * `singular` result that carries a `value`) is unwrapped to its enclosure so |
no outgoing calls
no test coverage detected