deno.land / x / rambda@v9.1.1 / source / uniqWith.spec.js

uniqWith.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { uniqWith as uniqWithRamda } from 'ramda'
import { uniqWith } from './uniqWith.js'
const list = [ { a : 1 }, { a : 1 } ]
test('happy', () => { const fn = (x, y) => x.a === y.a
const result = uniqWith(fn, list) expect(result).toEqual([ { a : 1 } ])})
test('with list of strings', () => { const fn = (x, y) => x.length === y.length const list = [ '0', '11', '222', '33', '4', '55' ] const result = uniqWith(fn)(list) const resultRamda = uniqWithRamda(fn, list) expect(result).toEqual([ '0', '11', '222' ]) expect(resultRamda).toEqual([ '0', '11', '222' ])})
rambda

Version Info

Tagged at
2 months ago