- Notifications
You must be signed in to change notification settings - Fork12
estools/esshorten
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
esshorten provides name mangler, this shorten names in JavaScript code. mangler accepts JavaScript AST and generate modified AST with shortened names.
We can use this with,
esshorten.mangle(AST);
And we can pass options to mangler,
esshorten.mangle(AST,{// If false, AST is copied deeply (default: true)destructive:false,// If false, avoid [JSC bug](https://github.com/mozilla/sweet.js/issues/138) (default: false)distinguishFunctionExpressionScope:false});
When destructive option is set to false, esshorten copies AST and modifies it.
Copyright (C) 2013Yusuke Suzuki(twitter:@Constellation) and other contributors.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED ANDON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
About
Shorten (mangle) names in JavaScript code