deno.land / x / rambda@v9.1.1 / source / innerJoin.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
37
38
39
40
41
42
import { curry } from './curry.js'
function _includesWith( pred, x, list){ let idx = 0 const len = list.length
while (idx < len){ if (pred(x, list[ idx ])) return true
idx += 1 }
return false}function _filter(fn, list){ let idx = 0 const len = list.length const result = []
while (idx < len){ if (fn(list[ idx ])) result[ result.length ] = list[ idx ]
idx += 1 }
return result}
export function innerJoinFn( pred, xs, ys){ return _filter(x => _includesWith( pred, x, ys ), xs)}
export const innerJoin = curry(innerJoinFn)
rambda

Version Info

Tagged at
2 months ago