-
Notifications
You must be signed in to change notification settings - Fork 40
/
enum.js
63 lines (61 loc) · 2.28 KB
/
enum.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
'use strict';
const _ = require('lodash');
module.exports = {
// comparisonOperators: [
// 'And',
// 'BooleanEquals',
// 'Not',
// 'NumericEquals',
// 'NumericGreaterThan',
// 'NumericGreaterThanEquals',
// 'NumericLessThan',
// 'NumericLessThanEquals',
// 'Or',
// 'StringEquals',
// 'StringGreaterThan',
// 'StringGreaterThanEquals',
// 'StringLessThan',
// 'StringLessThanEquals',
// 'TimestampEquals',
// 'TimestampGreaterThan',
// 'TimestampGreaterThanEquals',
// 'TimestampLessThan',
// 'TimestampLessThanEquals'
// ],
supportedComparisonOperator: [
'BooleanEquals',
'NumericEquals',
'NumericGreaterThan',
'NumericGreaterThanEquals',
'NumericLessThan',
'NumericLessThanEquals',
'StringEquals',
'StringGreaterThan',
'StringGreaterThanEquals',
'StringLessThan',
'StringLessThanEquals',
'TimestampEquals',
'TimestampGreaterThan',
'TimestampGreaterThanEquals',
'TimestampLessThan',
'TimestampLessThanEquals'
],
convertOperator: {
'BooleanEquals': (value, other) => _.eq(value, other),
'NumericEquals': (value, other) => _.eq(value, other),
'NumericGreaterThan': (value, other) => _.gt(value, other),
'NumericGreaterThanEquals': (value, other) => _.gte(value, other),
'NumericLessThan': (value, other) => _.lt(value, other),
'NumericLessThanEquals': (value, other) => _.lte(value, other),
'StringEquals': (value, other) => _.eq(value, other),
'StringGreaterThan': (value, other) => _.gt(value, other),
'StringGreaterThanEquals': (value, other) => _.gte(value, other),
'StringLessThan': (value, other) => _.lt(value, other),
'StringLessThanEquals': (value, other) => _.lte(value, other),
'TimestampEquals': (value, other) => _.eq(value, other),
'TimestampGreaterThan': (value, other) => _.gt(value, other),
'TimestampGreaterThanEquals': (value, other) => _.gte(value, other),
'TimestampLessThan': (value, other) => _.lt(value, other),
'TimestampLessThanEquals': (value, other) => _.lte(value, other)
}
};