@truedat/dq 4.28.8 → 4.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import _ from "lodash/fp";
2
2
 
3
3
  export default (operators, type, nested, scope, formatMessage) => {
4
- const filterFieldType = operators =>
5
- nested ? _.filter(o => o?.value_type !== "field")(operators) : operators;
4
+ const filterFieldType = (operators) =>
5
+ nested ? _.filter((o) => o?.value_type !== "field")(operators) : operators;
6
6
 
7
7
  const withValueType = (value, valueType) =>
8
8
  valueType ? `${value}.${valueType}` : value;
@@ -24,9 +24,9 @@ export default (operators, type, nested, scope, formatMessage) => {
24
24
  ? {
25
25
  icon: "random",
26
26
  label: formatMessage({
27
- id: `ruleImplementation.operator.group.${operator.label}`
27
+ id: `ruleImplementation.operator.group.${operator.label}`,
28
28
  }),
29
- options: _.map(renderOperatorOption)(operator.options)
29
+ options: _.map(renderOperatorOption)(operator.options),
30
30
  }
31
31
  : renderOperatorOption(operator);
32
32
 
@@ -35,10 +35,10 @@ export default (operators, type, nested, scope, formatMessage) => {
35
35
  id: withValueType(
36
36
  `ruleImplementation.operator.${operator.name}`,
37
37
  operator.value_type
38
- )
38
+ ),
39
39
  }),
40
40
  id: operator.id,
41
- value: withValueType(`${type}.${operator.name}`, operator.value_type)
41
+ value: withValueType(`${type}.${operator.name}`, operator.value_type),
42
42
  });
43
43
  const operatorsOptions = !type
44
44
  ? []
@@ -47,19 +47,20 @@ export default (operators, type, nested, scope, formatMessage) => {
47
47
  _.values,
48
48
  _.map(_.prop("operators")),
49
49
  _.flatten,
50
- _.filter(({ scope: op_scope }) =>
51
- _.isNull(op_scope) || _.isEmpty(op_scope) || _.isEqual(scope)(op_scope)
50
+ _.filter(
51
+ ({ scope: op_scope }) =>
52
+ _.isNull(op_scope) ||
53
+ _.isEmpty(op_scope) ||
54
+ _.isEqual(scope)(op_scope)
52
55
  ),
53
56
  filterFieldType,
54
- getOptions,
57
+ getOptions
55
58
  )(operators);
56
59
 
57
- const getOperatorValue = row =>
60
+ const getOperatorValue = (row) =>
58
61
  _.has("operator")(row) && !_.isEmpty(row.operator)
59
62
  ? withValueType(
60
- `${type}.${_.path("operator.name")(
61
- row
62
- )}`,
63
+ `${type}.${_.path("operator.name")(row)}`,
63
64
  _.path("operator.value_type")(row)
64
65
  )
65
66
  : null;
@@ -67,19 +68,15 @@ export default (operators, type, nested, scope, formatMessage) => {
67
68
  const typeCastModifiers = _.flow(
68
69
  _.toPairs,
69
70
  _.map(([key, value]) =>
70
- _.map(m => ({...m, sourceType: key}))(value.modifiers || [])
71
+ _.map((m) => ({ ...m, sourceType: key }))(value.modifiers || [])
71
72
  ),
72
73
  _.flatten,
73
- _.filter(({cast_as}) => cast_as === type)
74
- )(operators)
74
+ _.filter(({ cast_as }) => cast_as === type)
75
+ )(operators);
75
76
 
76
77
  return {
77
78
  operatorsOptions,
78
79
  getOperatorValue,
79
80
  typeCastModifiers,
80
- };
81
- }
82
-
83
-
84
-
85
-
81
+ };
82
+ };
@@ -290,6 +290,6 @@ export const getRuleImplementationOperators = createSelector(
290
290
  modifiers: _.propOr([], `${key}.modifiers`)(operators),
291
291
  })(acc),
292
292
  {}
293
- ),
293
+ )
294
294
  )(operators)
295
295
  );