forked from ramda/ramda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find-where.bench.js
40 lines (38 loc) · 976 Bytes
/
find-where.bench.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
var R = require('../..');
var objs = [
{x: [1, 2], y: true},
{x: [1, 3], y: true},
{x: [], y: false},
{x: [2], y: false},
{x: [3], y: true},
{x: [1], y: true},
{x: [1, 2, 3], y: true},
{x: [], y: true},
{x: [1, 2], y: false},
{x: [1, 3], y: true}
];
var findEmptyX = R.find(R.where({x: R.isEmpty}));
var findFalseY = R.find(R.whereEq({y: false}));
module.exports = {
name: 'find where',
tests: {
'find(where({x: isEmpty}), objs)': function() {
R.find(R.where({x: R.isEmpty}), objs);
},
'find(where({x: isEmpty}))(objs)': function() {
R.find(R.where({x: R.isEmpty}))(objs);
},
'findEmptyX(objs)': function() {
findEmptyX(objs);
},
'find(whereEq({y: false}), objs)': function() {
R.find(R.whereEq({y: false}), objs);
},
'find(whereEq({y: false}))(objs)': function() {
R.find(R.whereEq({y: false}))(objs);
},
'findFalseY(objs)': function() {
findFalseY(objs);
}
}
};