@opengis/fastify-table 1.4.58 → 1.4.59
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/package.json
CHANGED
|
@@ -10,13 +10,13 @@ function checkField(key, val, options, idx, body) {
|
|
|
10
10
|
// validators: [required]
|
|
11
11
|
if (type === 'switcher') {
|
|
12
12
|
// skip nulls at non-required switchers, restrict invalid values
|
|
13
|
-
if (val && typeof val !== 'boolean') {
|
|
13
|
+
if (val && typeof val !== 'boolean' && !['true', 'false'].includes(val)) {
|
|
14
14
|
return {
|
|
15
15
|
error: 'not a boolean', key, idx,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
// restrict nulls at required switchers
|
|
19
|
-
if (isrequired && typeof val !== 'boolean') {
|
|
19
|
+
if (isrequired && typeof val !== 'boolean' && !['true', 'false'].includes(val)) {
|
|
20
20
|
return {
|
|
21
21
|
error: 'empty required', key, idx,
|
|
22
22
|
};
|