fix(striker-ui-api): correct sanitize boolean

main
Tsu-ba-me 1 year ago
parent 823f0780b1
commit d04fef2372
  1. 2
      striker-ui-api/src/lib/sanitize.ts

@ -29,7 +29,7 @@ const MAP_TO_MODIFIER_FUNCTION: MapToModifierFunction = {
};
const MAP_TO_RETURN_FUNCTION: MapToReturnFunction = {
boolean: (value) => value !== undefined,
boolean: (value) => Boolean(value),
number: (value, mod, fallback = 0) => parseFloat(String(value)) || fallback,
string: (value, mod, fallback = '') => (value ? mod(value) : fallback),
'string[]': (value, mod, fallback = []) => {

Loading…
Cancel
Save