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

Way to not repeat "require(data.json)" #4

Open
helmasaur opened this issue Jan 12, 2020 · 0 comments
Open

Way to not repeat "require(data.json)" #4

helmasaur opened this issue Jan 12, 2020 · 0 comments
Milestone

Comments

@helmasaur
Copy link
Owner

This piece of code appears many times:

let signsLocale;
try {
	signsLocale = Object.values(require(`./locales/${language}/zodiac.json`));
} catch {
	signsLocale = Object.values(require('./locales/en/zodiac.json'));
}

Is there a way where the file is imported once only?

@helmasaur helmasaur modified the milestones: v1.0.0, v1.1.0 Jan 12, 2020
@helmasaur helmasaur modified the milestones: v1.4.0, v1.5.0 Sep 2, 2023
@helmasaur helmasaur modified the milestones: v1.5.0, 1.6.0 Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant