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

feat: export message merging utilities to shared module #1635

Conversation

BobbieGoede
Copy link
Member

@BobbieGoede BobbieGoede commented Nov 16, 2023

This PR only moves deepCopy to @intlify/shared, at first I thought maybe it would be useful to move the handleFlatJson utility function as well but the changes would be more involved, maybe some other time.

Due to moving the function the error formatting is not as easily accessible, as you can see throw createI18nError(I18nErrorCodes.INVALID_VALUE) is replaced with a plain throw new Error('Invalid value'), let me know if this should be different.

Locally I tested importing this deepCopy function in @nuxtjs/i18n, this will fix an issue after implementing (nuxt-modules/i18n#2476) which is nice, less code and fewer bugs! 😄

Resolves #1634

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good contribution!
Thanks! :)

@kazupon kazupon changed the title refactor: move message merging utilities to shared module feat: export message merging utilities to shared module Nov 16, 2023
@kazupon kazupon added the Type: Feature Includes new features label Nov 16, 2023
@kazupon kazupon merged commit 9d337bf into intlify:master Nov 16, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export message merging utilities or move to shared
2 participants