Closed pyramation closed 4 months ago
Looks like it does the job, but the option could be more clear. JsonSafe
is a utility type, but doesn't really express the intent for the person setting the option.
Consider, prototypes.typingsFormat.returnKnown. That contracts with the
unknown` default.
Though if it were me I'd always return the typed value and not have an option. I can't think of why anyone would prefer to get unknown
to the true value. It also shouldn't be considered a breaking change since the change improves accuracy. (i.e. any type check that breaks with this is revealing a bug)
great feedback @turadg
The reason we use options (for any feature) is so developers that upgrade can choose to have few code changes as possible since a large amount of code is generated.
I would suggest we do two phases. One smaller release (patch) with the option defaulting to unknown, and then a minor release to make it the default to have types
JsonSafe
helper typeprototypes.typingsFormat.jsonSafe
optionshould close #605
cc @turadg