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

Use const enum for UrlType #120

Merged
merged 1 commit into from Feb 14, 2024
Merged

Use const enum for UrlType #120

merged 1 commit into from Feb 14, 2024

Conversation

sapphi-red
Copy link
Contributor

This PR changes UrlType type to const enum from enum.

This change makes this package

  • UrlType tree-shake friendly
    • TypeScript enum cannot be tree-shaked but const enum can be
  • smaller
    • The file size with terser is reduced by ~18% (before: 2303B, after: 1891B)

@jridgewell
Copy link
Owner

Excellent, thanks!

@jridgewell jridgewell merged commit e4b1e34 into jridgewell:main Feb 14, 2024
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.

None yet

2 participants