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

applyDiff-spec.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {applyDiff} from 'rambda'
interface Output { a: { b: number, d: number, },}
describe('R.applyDiff', () => { it('happy', async() => { const obj = {a: {b: 1, c: 2}} const rules = [ {op: 'remove', path: 'a.c'} as const, {op: 'add', path: 'a.d', value: 4} as const, {op: 'update', path: 'a.b', value: 2} as const, ] const result = applyDiff<Output>(rules, obj) result // $ExpectType Output })})
rambda

Version Info

Tagged at
2 months ago