deno.land / x / rambda@v9.1.1 / src / uniqWith.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function includesWith( predicate, target, list){ let willReturn = false let index = -1
while (++index < list.length && !willReturn){ const value = list[ index ]
if (predicate(target, value)){ willReturn = true } }
return willReturn}
export function uniqWith(predicate, list){ if (arguments.length === 1) return _list => uniqWith(predicate, _list)
let index = -1 const willReturn = []
while (++index < list.length){ const value = list[ index ]
if (!includesWith( predicate, value, willReturn )){ willReturn.push(value) } }
return willReturn}
rambda

Version Info

Tagged at
2 months ago