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: TypeError when requiring discord.js #573

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Conversation

favna
Copy link
Member

@favna favna commented Jul 11, 2024

fixes #547

Fix the TypeError when getting the output type of "require('discord.js')".

  • Modify Type.resolve method in src/lib/index.ts to handle cases where the constructor is null.
    • Add a check to return 'Object' if the constructor is null.
  • Add a test case in tests/objects.test.ts to verify the handling of modules with null constructors.
  • Add a new test file tests/module.test.ts to test the Type class with the discord.js module.
  • Update package.json to include discord.js as a dev dependency.
  • Update vitest.config.ts to exclude the scripts/ directory from coverage.

For more details, open the Copilot Workspace session.

@favna favna changed the title Fix TypeError when requiring discord.js fix: TypeError when requiring discord.js Jul 11, 2024
vladfrangu
vladfrangu previously approved these changes Jul 11, 2024
@favna favna merged commit 06e6afc into main Jul 11, 2024
59 checks passed
@favna favna deleted the favna/favna/fix-type-error branch July 11, 2024 18:48
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.

bug: Error when getting output type of "require('discord.js')"
2 participants