@truedat/df 4.53.8 → 4.53.9
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.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/df",
|
|
3
|
-
"version": "4.53.
|
|
3
|
+
"version": "4.53.9",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.4",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.53.
|
|
37
|
+
"@truedat/test": "4.53.9",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@truedat/auth": "4.53.
|
|
91
|
-
"@truedat/core": "4.53.
|
|
90
|
+
"@truedat/auth": "4.53.9",
|
|
91
|
+
"@truedat/core": "4.53.9",
|
|
92
92
|
"path-to-regexp": "^1.7.0",
|
|
93
93
|
"prop-types": "^15.8.1",
|
|
94
94
|
"react-color": "^2.17.3",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"react-dom": ">= 16.8.6 < 17",
|
|
107
107
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "cfb29ec044aeb972df15ad73f30cf7fb06e2a54b"
|
|
110
110
|
}
|
|
@@ -3,25 +3,26 @@ import { filterSwitches, isSwitch, isSwitchValid } from "..";
|
|
|
3
3
|
const switchValues1 = {
|
|
4
4
|
foo: ["foo1", "foo2", "foo3"],
|
|
5
5
|
bar: ["bar1", "bar2", "bar3"],
|
|
6
|
-
baz: ["baz1", "baz2", "baz3"]
|
|
6
|
+
baz: ["baz1", "baz2", "baz3"],
|
|
7
7
|
};
|
|
8
|
+
|
|
8
9
|
const switch1 = {
|
|
9
10
|
name: "target",
|
|
10
11
|
values: {
|
|
11
12
|
switch: {
|
|
12
13
|
on: "src",
|
|
13
|
-
values: switchValues1
|
|
14
|
-
}
|
|
15
|
-
}
|
|
14
|
+
values: switchValues1,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
16
17
|
};
|
|
17
18
|
const switch2 = {
|
|
18
19
|
name: "target2",
|
|
19
20
|
values: {
|
|
20
21
|
switch: {
|
|
21
22
|
on: "src",
|
|
22
|
-
values: switchValues1
|
|
23
|
-
}
|
|
24
|
-
}
|
|
23
|
+
values: switchValues1,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
25
26
|
};
|
|
26
27
|
const templateContent = [switch1, switch2];
|
|
27
28
|
|
|
@@ -37,6 +38,8 @@ describe("utils: isSwitchValid", () => {
|
|
|
37
38
|
expect(validator({ src: "foo", target: "foo1" })).toBe(true);
|
|
38
39
|
expect(validator({ src: "bar", target: "bar2" })).toBe(true);
|
|
39
40
|
expect(validator({ src: "baz", target: "xyzzy" })).toBe(false);
|
|
41
|
+
expect(validator({ src: "foo", target: ["foo1"] })).toBe(true);
|
|
42
|
+
expect(validator({ src: "foo", target: "" })).toBe(true);
|
|
40
43
|
});
|
|
41
44
|
});
|
|
42
45
|
|
|
@@ -17,7 +17,12 @@ export const isSwitchValid = (prop, on) =>
|
|
|
17
17
|
_.map.convert({ cap: false })((validValues, onValue) =>
|
|
18
18
|
_.conformsTo({
|
|
19
19
|
[on]: _.eq(onValue),
|
|
20
|
-
[prop]: (v) =>
|
|
20
|
+
[prop]: (v) =>
|
|
21
|
+
isEmpty(v)
|
|
22
|
+
? true
|
|
23
|
+
: _.isArray(v)
|
|
24
|
+
? _.isEmpty(_.without(validValues)(v))
|
|
25
|
+
: _.includes(v)(validValues),
|
|
21
26
|
})
|
|
22
27
|
),
|
|
23
28
|
_.overSome
|