mojotech / json-type-validation

TypeScript JSON type validation
MIT License
155 stars 15 forks source link

object() compiles to Object() in Babel which breaks the lib #47

Closed tohagan closed 4 years ago

tohagan commented 4 years ago

I'm planning on using this API in Vue that uses the Babel compiler. I found that you're using what I suspect are reserved words (object, number, string) as function names that I found are unsafe to compile in Babel. Example: object() is translated to Object() which fails to execute the correct function.

I'd need to fork your project and rename these to something like vObject(), vString() etc or perhaps use JsonDecode.

tohagan commented 4 years ago

I've fixed this with many breaking changes and some additions in a new fork of this project. I'm afraid there were way too many changes to turn it into a PR. I've retained your name on the MIT licence.