@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.4.58",
3
+ "version": "1.4.59",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -59,4 +59,4 @@
59
59
  },
60
60
  "author": "Softpro",
61
61
  "license": "ISC"
62
- }
62
+ }
@@ -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
  };