deno.land / x / rambda@v9.1.1 / source / pathOr-spec.ts

pathOr-spec.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import {pathOr} from 'rambda'
describe('R.pathOr', () => { it('with string path', () => { const x = pathOr<string>('foo', 'x.y', {x: {y: 'bar'}}) x // $ExpectType string }) it('with array path', () => { const x = pathOr<string>('foo', ['x', 'y'], {x: {y: 'bar'}}) x // $ExpectType string }) it('without passing type looks bad', () => { const x = pathOr('foo', 'x.y', {x: {y: 'bar'}}) x // $ExpectType "foo" }) it('curried', () => { const x = pathOr<string>('foo', 'x.y')({x: {y: 'bar'}}) x // $ExpectType string })})
rambda

Version Info

Tagged at
2 months ago