phetsims / query-string-machine

Query String Machine is a query string parser that supports type coercion, default values & validation. No dependencies.
MIT License
3 stars 3 forks source link

flag should error when "defaultValue" is provided. #21

Closed samreid closed 7 years ago

samreid commented 7 years ago

From https://github.com/phetsims/chipper/issues/519. We decided that type:flag should not permit defaultValue--it is too confusing and type:boolean should be used for those cases.

samreid commented 7 years ago

The schema for flag is now:

      flag: {
        required: [],
        optional: [],
        validate: validateFlag,
        parse: parseFlag
      },

If I try to supply a default value for a flag, I am met with:

Error: Assertion failed: unsupported property: defaultValue