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

[Feature Request] Minify String#repeat calls when appropriate #1329

Closed
LeoDog896 opened this issue Jan 4, 2023 · 1 comment · Fixed by #1330
Closed

[Feature Request] Minify String#repeat calls when appropriate #1329

LeoDog896 opened this issue Jan 4, 2023 · 1 comment · Fixed by #1330

Comments

@LeoDog896
Copy link
Contributor

LeoDog896 commented Jan 4, 2023

When String#repeat is given a value with a known value (whether through inlining or directly), should run the repeat method whenever the result is smaller.

Input (with unsafe compress set to true):

export const a = "a".repeat(4);

Terser Output:

export const a="a".repeat(4);

Expected output:

export const a="aaaa";
@LeoDog896

This comment was marked as outdated.

@LeoDog896 LeoDog896 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2023
@LeoDog896 LeoDog896 reopened this Jan 4, 2023
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 a pull request may close this issue.

1 participant