rambdax
Version:
Extended version of Rambda - a lightweight, faster alternative to Ramda
27 lines (24 loc) • 504 B
text/typescript
import {Boolean} from './Boolean'
/**
Logical `||` operator (behaves like the JS one)
```ts
import {B} from 'ts-toolbelt'
type test0 = B.Or<B.True, B.False> // True
type test1 = B.Or<B.True, B.True> // True
type test2 = B.Or<B.Boolean, B.False> // Boolean
```
*/
export type Or<B1 extends Boolean, B2 extends Boolean> = {
0: {
0: 0
1: 1
}
1: {
0: 1
1: 1
}
}[B1][B2]