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 declaration types for TypeScript support #206

Merged
merged 3 commits into from Apr 1, 2022
Merged

Fix declaration types for TypeScript support #206

merged 3 commits into from Apr 1, 2022

Conversation

Gorniaky
Copy link
Contributor

@Gorniaky Gorniaky commented Mar 24, 2022

Fixes #205

@utarwyn
Copy link
Owner

utarwyn commented Apr 1, 2022

Hello, thank you for this contribution to the module! Really appreciated 👍

But I have the impression that the alias replacing script is not working for all imports, an example for DuelRequest.d.ts file after a build on my computer:
image

After few tests I have discovered that the script tries to match a double quote to delimitate end of imports. This works in generated JS but TypeScript still uses single quote in generated types.

.map(key => new RegExp(`${key.split('/*')[0]}/[^"]*`, 'g'));

So, I propose you to add the single quote in the regex like this:

new RegExp(`${key.split('/*')[0]}/[^'"]*`, 'g')

Regards

@utarwyn utarwyn added the type: enhancement Features and feature requests. label Apr 1, 2022
@Gorniaky
Copy link
Contributor Author

Gorniaky commented Apr 1, 2022

Hello, thank you for this contribution to the module! Really appreciated 👍

But I have the impression that the alias replacing script is not working for all imports, an example for DuelRequest.d.ts file after a build on my computer: image

After few tests I have discovered that the script tries to match a double quote to delimitate end of imports. This works in generated JS but TypeScript still uses single quote in generated types.

.map(key => new RegExp(`${key.split('/*')[0]}/[^"]*`, 'g'));

So, I propose you to add the single quote in the regex like this:

new RegExp(`${key.split('/*')[0]}/[^'"]*`, 'g')

Regards

Oh really! I didn't foresee this error...

@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Owner

@utarwyn utarwyn left a comment

Choose a reason for hiding this comment

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

LGTM 💯 Thank you!

@utarwyn utarwyn merged commit 6ad4941 into utarwyn:next Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There are no declared types for TypeScript
2 participants