Closed pixelzoom closed 7 years ago
Looking more closely at the current state of QueryStringMachine... There's a lot of conditional logic in validateSchema
and parseElement
. And it's difficult to make a change (e.g. https://github.com/phetsims/chipper/issues/519) to the behavior of one type without affecting others. We could improve the readability and maintainability by breaking things up into type-specific validation and parsing functions. E.g., validateFlag
and parseFlag
, validateBoolean
and parseBoolean
, etc.
The queryStringMachineAssert
calls identified in https://github.com/phetsims/query-string-machine/issues/19#issue-191110685 should also probably be plain old assert
. They are validating the schema, not a value provided by a user.
Closed, move to https://github.com/phetsims/query-string-machine/issues/20.
These checks appear in QueryStringMachine
parseElement
:And this check appears in
stringToArray
:These are all related to schema validation. Shouldn't they be located in
validateSchema
?