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

ts: exclude index.ts files from been imported in standalone mode #19

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

ronenlu
Copy link
Member

@ronenlu ronenlu commented Dec 10, 2024

thanks for @zeta-squared

@ronenlu ronenlu changed the title ts: exclude index.ts files from been imported ts: exclude index.ts files from been imported in standalone mode Dec 10, 2024
@zeta-squared
Copy link

Thank you @ronenlu. It's a pleasure to contribute to such a useful tool, even though it was a relatively small increment.

const sequelize = new Sequelize({
dialect: argv.dialect,
models: [absolutePath + "/*.ts"],
models: models,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
models: models,
models: files.reduce((models, file) => {
if (file !== "index.ts" && file.endsWith(".ts")) {
models.push(absolutePath + "/" + file)
}
return models;
}, []),

More JS'ish but just a suggestion.

@ronenlu ronenlu merged commit e8f4df9 into master Dec 10, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants