Validate that default value is string or numeric #45

wants to merge 1 commit into


None yet

2 participants


Right now there is an implicit* validation done after the read (, but I think it might be helpful to do an explicit validation beforehand.

  • implicit only because it's not strictly testing the default value, unless the default is being returned
a decoupled application framework member

@alex-seville typeof defaultLine !== 'numeric' is not valid javascript. I believe you want typeof defaultLine !== 'number'

@alex-seville alex-seville Validate that default value is string or numeric. Ignore otherwise.
Fixed typo

wrote numeric instead of number

If default is not string, try casting it

Number gets ignored on the way back anyway, so it's best to string converting it to a string

I made a mess of the commits, so I squashed them.

I also noticed that number values would be ignored after reading by the same code on L463, so I modified the code to try doing a toString() to non-string values (to convert numbers). That way it's string in/string out.


P.S. Read v.1.0.3 won't accept objects or arrays as a default value (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment