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

Documentation and type definition: MinifyOptions.enclose #1021

Merged
merged 1 commit into from Jul 10, 2021

Conversation

hanazuki
Copy link
Contributor

@hanazuki hanazuki commented Jul 6, 2021

This patch updates the documentation to explain the existing enclose option, and also modifies the type definition of MinifyOptions to accept the enclose field.

Related lines of code:

terser/lib/minify.js

Lines 186 to 188 in d3d924f

if (options.enclose) {
toplevel = toplevel.wrap_enclose(options.enclose);
}

terser/lib/ast.js

Lines 448 to 451 in d3d924f

wrap_enclose: function(args_values) {
if (typeof args_values != "string") args_values = "";
var index = args_values.indexOf(":");
if (index < 0) index = args_values.length;

This patch updates the documentation to explain the existing
`enclose` option, and also modifies the type definition of
`MinifyOptions` to accept the `enclose` field.
@fabiosantoscode
Copy link
Collaborator

👍 Cool stuff, thanks!

I had no idea people still used this option.

@fabiosantoscode fabiosantoscode merged commit 6b62c00 into terser:master Jul 10, 2021
@hanazuki hanazuki deleted the type-enclose branch July 23, 2021 21:14
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