Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Provide named export alongside default export #88

Closed

Conversation

cj-christoph-gysin
Copy link

What issue does this pull request resolve?

Fixes ajv-validator/ajv#2132
Related to ajv-validator/ajv#2352.

What changes did you make?

17382ff: Created additional named export addFormats to the default export.
f330032: Updated the documentation to use the named exports consistently.

Is there anything that requires more attention while reviewing?

The default export is the FormatsPlugin instance, but in all examples it is referred to as addFormats. This is a bit confusing, as there is another addFormats function that is used only internally and is not exported. I renamed it to _addFormats to avoid a naming conflict.

The existing default exports are untouched, so backwards compatibility is guaranteed.

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

Successfully merging this pull request may close these issues.

Typescipt and ESM yields "Ajv This expression is not constructable"
1 participant