Bugfix: Only fall back to default value if sanitizer returns undefined

Fixes #72
This commit is contained in:
Aria Minaei 2022-02-09 20:43:11 +01:00 committed by Aria
parent 590a8e3740
commit 1b85707833

View file

@ -169,12 +169,21 @@ export default class SheetObject implements IdentityDerivationProvider {
if (!triple)
return valsAtom.setIn(pathToProp, propConfig!.default)
const left = sanitize(triple.left) || propConfig.default
const leftSanitized = sanitize(triple.left)
const left =
typeof leftSanitized === 'undefined'
? propConfig.default
: leftSanitized
if (triple.right === undefined)
return valsAtom.setIn(pathToProp, left)
const right = sanitize(triple.right) || propConfig.default
const rightSanitized = sanitize(triple.right)
const right =
typeof rightSanitized === 'undefined'
? propConfig.default
: rightSanitized
return valsAtom.setIn(
pathToProp,