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

modifyPath-spec.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {modifyPath} from 'rambda'
const obj = {a: {b: {c: 1}}}
describe('R.modifyPath', () => { it('happy', () => { const result = modifyPath('a.b.c', (x: number) => x + 1, obj) result // $ExpectType Record<string, unknown> }) it('explicit return type', () => { interface Foo extends Record<string, unknown> { a: 1, } const result = modifyPath<Foo>('a.b.c', (x: number) => x + 1, obj) result // $ExpectType Foo })})
rambda

Version Info

Tagged at
2 months ago