@types/uglify-js
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -6,2 +6,3 @@ // Type definitions for UglifyJS 3.0 | ||
// John Reilly <https://github.com/johnnyreilly> | ||
// Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -20,28 +21,77 @@ // TypeScript Version: 2.2 | ||
export interface CompressOptions { | ||
/** Replace `arguments[index]` with function parameter name whenever possible. */ | ||
/** | ||
* Replace `arguments[index]` with function parameter name whenever possible. | ||
* @default true | ||
*/ | ||
arguments?: boolean; | ||
/** Various optimizations for boolean context, for example `!!a ? b : c → a ? b : c` */ | ||
/** | ||
* Apply optimizations to assignment expressions | ||
* @default ture | ||
*/ | ||
assignments?: boolean; | ||
/** | ||
* Various optimizations for boolean context, for example `!!a ? b : c → a ? b : c` | ||
* @default true | ||
*/ | ||
booleans?: boolean; | ||
/** Collapse single-use non-constant variables, side effects permitting. */ | ||
/** | ||
* Collapse single-use non-constant variables, side effects permitting. | ||
* @default true | ||
*/ | ||
collapse_vars?: boolean; | ||
/** Apply certain optimizations to binary nodes, e.g. `!(a <= b) → a > b,` attempts to negate binary nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc */ | ||
/** | ||
* Apply certain optimizations to binary nodes, e.g. `!(a <= b) → a > b,` attempts to negate binary nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc | ||
* @default true | ||
*/ | ||
comparisons?: boolean; | ||
/** Apply optimizations for `if-s` and conditional expressions. */ | ||
/** | ||
* Apply optimizations for `if-s` and conditional expressions. | ||
* @default true | ||
*/ | ||
conditionals?: boolean; | ||
/** Remove unreachable code */ | ||
/** | ||
* Remove unreachable code | ||
* @default true | ||
*/ | ||
dead_code?: boolean; | ||
/** | ||
* remove redundant or non-standard directives | ||
* @default true | ||
*/ | ||
directives?: boolean; | ||
/** | ||
* Pass `true` to discard calls to console.* functions. | ||
* If you wish to drop a specific function call such as `console.info` and/or retain side effects from function | ||
* arguments after dropping the function call then use `pure_funcs` instead. | ||
* @default true | ||
*/ | ||
drop_console?: boolean; | ||
/** Remove `debugger;` statements */ | ||
/** | ||
* Remove `debugger;` statements | ||
* @default true | ||
*/ | ||
drop_debugger?: boolean; | ||
/** Attempt to evaluate constant expressions */ | ||
/** | ||
* Attempt to evaluate constant expressions | ||
* @default true | ||
*/ | ||
evaluate?: boolean; | ||
/** Pass `true` to preserve completion values from terminal statements without `return`, e.g. in bookmarklets. */ | ||
/** | ||
* Pass `true` to preserve completion values from terminal statements without `return`, e.g. in bookmarklets. | ||
* @default false | ||
*/ | ||
expression?: boolean; | ||
/** | ||
* convert declarations from varto function whenever possible | ||
* @default true | ||
*/ | ||
functions?: boolean; | ||
/** | ||
* @default {} | ||
*/ | ||
global_defs?: object; | ||
/** hoist function declarations */ | ||
/** | ||
* hoist function declarations | ||
* @default false | ||
*/ | ||
hoist_funs?: boolean; | ||
@@ -52,7 +102,14 @@ /** | ||
* the compress option passes set to 2 or higher, and the compress option toplevel enabled. | ||
* @default true | ||
*/ | ||
hoist_props?: boolean; | ||
/** Hoist var declarations (this is `false` by default because it seems to increase the size of the output in general) */ | ||
/** | ||
* Hoist var declarations (this is `false` by default because it seems to increase the size of the output in general) | ||
* @default false | ||
*/ | ||
hoist_vars?: boolean; | ||
/** Optimizations for if/return and if/continue */ | ||
/** | ||
* Optimizations for if/return and if/continue | ||
* @default true | ||
*/ | ||
if_return?: boolean; | ||
@@ -67,19 +124,54 @@ /** | ||
* - true -- same as `WithArgumentsAndVariables` | ||
* @default true | ||
*/ | ||
inline?: boolean | InlineFunctions; | ||
/** join consecutive `var` statements */ | ||
/** | ||
* join consecutive `var` statements | ||
* @default true | ||
*/ | ||
join_vars?: boolean; | ||
/** Prevents the compressor from discarding unused function arguments. You need this for code which relies on `Function.length` */ | ||
keep_fargs?: boolean; | ||
/** Pass true to prevent the compressor from discarding function names. Useful for code relying on `Function.prototype.name`. */ | ||
/** | ||
* Prevents the compressor from discarding unused function arguments. | ||
* You need this for code which relies on `Function.length` | ||
* @default 'strict' | ||
*/ | ||
keep_fargs?: 'strict' | boolean; | ||
/** | ||
* Pass true to prevent the compressor from discarding function names. | ||
* Useful for code relying on `Function.prototype.name`. | ||
* @default false | ||
*/ | ||
keep_fnames?: boolean; | ||
/** Pass true to prevent Infinity from being compressed into `1/0`, which may cause performance issues on `Chrome` */ | ||
/** | ||
* Pass true to prevent Infinity from being compressed into `1/0`, which may cause performance issues on `Chrome` | ||
* @default false | ||
*/ | ||
keep_infinity?: boolean; | ||
/** Optimizations for `do`, `while` and `for` loops when we can statically determine the condition. */ | ||
/** | ||
* Optimizations for `do`, `while` and `for` loops when we can statically determine the condition. | ||
* @default true | ||
*/ | ||
loops?: boolean; | ||
/** negate `Immediately-Called Function Expressions` where the return value is discarded, to avoid the parens that the code generator would insert. */ | ||
/** | ||
* negate `Immediately-Called Function Expressions` where the return value is discarded, | ||
* to avoid the parens that the code generator would insert. | ||
* @default true | ||
*/ | ||
negate_iife?: boolean; | ||
/** The maximum number of times to run compress. In some cases more than one pass leads to further compressed code. Keep in mind more passes will take more time. */ | ||
/** | ||
* compact duplicate keys in object literals | ||
* @default true | ||
*/ | ||
objects?: boolean; | ||
/** | ||
* The maximum number of times to run compress. | ||
* In some cases more than one pass leads to further compressed code. | ||
* Keep in mind more passes will take more time. | ||
* @default 1 | ||
*/ | ||
passes?: number; | ||
/** Rewrite property access using the dot notation, for example `foo["bar"]` to `foo.bar` */ | ||
/** | ||
* Rewrite property access using the dot notation, for example `foo["bar"]` to `foo.bar` | ||
* @default true | ||
*/ | ||
properties?: boolean; | ||
@@ -94,4 +186,12 @@ /** | ||
* implementation adds some overhead (compression will be slower). | ||
* @default null | ||
*/ | ||
pure_funcs?: string[]; | ||
pure_funcs?: string[] | null; | ||
/** | ||
* If you pass true for this, UglifyJS will assume that object property access | ||
* (e.g. foo.bar or foo["bar"]) doesn't have any side effects. | ||
* Specify "strict" to treat foo.bar as side-effect-free only when foo is certain to not throw, | ||
* i.e. not null or undefine | ||
* @default 'strict' | ||
*/ | ||
pure_getters?: boolean | 'strict'; | ||
@@ -102,31 +202,98 @@ /** | ||
* this option is disabled. Does not negatively impact other major browsers. | ||
* @default true | ||
*/ | ||
reduce_funcs?: boolean; | ||
/** Improve optimization on variables assigned with and used as constant values. */ | ||
/** | ||
* Improve optimization on variables assigned with and used as constant values. | ||
* @default true | ||
*/ | ||
reduce_vars?: boolean; | ||
/** | ||
* join consecutive simple statements using the comma operator. | ||
* May be set to a positive integer to specify the maximum number of | ||
* consecutive comma sequences that will be generated. | ||
* If this option is set to true then the default sequences limit is 200. | ||
* Set option to false or 0 to disable. The smallest sequences length is 2. | ||
* A sequences value of 1 is grandfathered to be equivalent to true and as such means 200. | ||
* On rare occasions the default sequences limit leads to very slow compress times in which case | ||
* a value of 20 or less is recommended | ||
* @default true | ||
*/ | ||
sequences?: boolean; | ||
/** Pass false to disable potentially dropping functions marked as "pure". */ | ||
/** | ||
* Pass false to disable potentially dropping functions marked as "pure". | ||
* @default true | ||
*/ | ||
side_effects?: boolean; | ||
/** De-duplicate and remove unreachable `switch` branches. */ | ||
/** | ||
* compact string concatenations | ||
* @default true | ||
*/ | ||
strings?: boolean; | ||
/** | ||
* De-duplicate and remove unreachable `switch` branches. | ||
* @default true | ||
*/ | ||
switches?: boolean; | ||
/** Drop unreferenced functions ("funcs") and/or variables ("vars") in the top level scope (false by default, true to drop both unreferenced functions and variables) */ | ||
/** | ||
* Drop unreferenced functions ("funcs") and/or variables ("vars") in the top level scope (false by default, | ||
* true to drop both unreferenced functions and variables) | ||
* @default false | ||
*/ | ||
toplevel?: boolean; | ||
/** Prevent specific toplevel functions and variables from unused removal (can be array, comma-separated, RegExp or function. Implies toplevel) */ | ||
top_retain?: boolean; | ||
/** | ||
* Prevent specific toplevel functions and variables from unused removal | ||
* (can be array, comma-separated, RegExp or function. Implies toplevel) | ||
* @default null | ||
*/ | ||
top_retain?: boolean | null; | ||
/** | ||
* Transforms typeof foo == "undefined" into foo === void 0. | ||
* Note: recommend to set this value to false for IE10 and earlier versions due to known issues | ||
* @default true | ||
*/ | ||
typeofs?: boolean; | ||
/** | ||
* apply "unsafe" transformations (discussion below) | ||
* @default false | ||
*/ | ||
unsafe?: boolean; | ||
/** Compress expressions like a `<= b` assuming none of the operands can be (coerced to) `NaN`. */ | ||
/** | ||
* Compress expressions like a `<= b` assuming none of the operands can be (coerced to) `NaN`. | ||
* @default false | ||
*/ | ||
unsafe_comps?: boolean; | ||
/** Compress and mangle `Function(args, code)` when both args and code are string literals. */ | ||
/** | ||
* Compress and mangle `Function(args, code)` when both args and code are string literals. | ||
* @default false | ||
*/ | ||
unsafe_Function?: boolean; | ||
/** Optimize numerical expressions like `2 * x * 3` into `6 * x`, which may give imprecise floating point results. */ | ||
/** | ||
* Optimize numerical expressions like `2 * x * 3` into `6 * x`, | ||
* which may give imprecise floating point results. | ||
* @default false | ||
*/ | ||
unsafe_math?: boolean; | ||
/** Optimize expressions like `Array.prototype.slice.call(a)` into `[].slice.call(a)` */ | ||
/** | ||
* Optimize expressions like `Array.prototype.slice.call(a)` into `[].slice.call(a)` | ||
* @default false | ||
*/ | ||
unsafe_proto?: boolean; | ||
/** Enable substitutions of variables with `RegExp` values the same way as if they are constants. */ | ||
/** | ||
* Enable substitutions of variables with `RegExp` values the same way as if they are constants. | ||
* @default false | ||
*/ | ||
unsafe_regexp?: boolean; | ||
/** | ||
* substitute void 0 if there is a variable named undefined in scope | ||
* (variable name will be mangled, typically reduced to a single character) | ||
* @default false | ||
*/ | ||
unsafe_undefined?: boolean; | ||
/** | ||
* drop unreferenced functions and variables | ||
* (simple direct variable assignments do not count as references unless set to "keep_assign") | ||
* @default true | ||
*/ | ||
unused?: boolean; | ||
/** display warnings when dropping unreachable code or unused declarations etc. */ | ||
warnings?: boolean; | ||
} | ||
@@ -133,0 +300,0 @@ |
{ | ||
"name": "@types/uglify-js", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "TypeScript definitions for UglifyJS", | ||
@@ -21,9 +21,15 @@ "license": "MIT", | ||
"githubUsername": "johnnyreilly" | ||
}, | ||
{ | ||
"name": "Piotr Błażejewicz", | ||
"url": "https://github.com/peterblazejewicz", | ||
"githubUsername": "peterblazejewicz" | ||
} | ||
], | ||
"main": "", | ||
"types": "", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/uglify-js" | ||
}, | ||
@@ -34,4 +40,4 @@ "scripts": {}, | ||
}, | ||
"typesPublisherContentHash": "981479abad73c634cb98f4f02450ad0f32ea13c5ec2ebde9a6d01d4daa3bcd6e", | ||
"typeScriptVersion": "2.2" | ||
"typesPublisherContentHash": "d680443ddbfeb27d571b215fe366d7efa1754db0e5d49a7ef18a205afc4f8dab", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uglify-js | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uglify-js. | ||
Additional Details | ||
* Last updated: Mon, 15 Oct 2018 17:21:49 GMT | ||
* Dependencies: source-map | ||
### Additional Details | ||
* Last updated: Tue, 31 Mar 2020 22:55:45 GMT | ||
* Dependencies: [@types/source-map](https://npmjs.com/package/@types/source-map) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Alan Agius <https://github.com/alan-agius4>, Tanguy Krotoff <https://github.com/tkrotoff>, John Reilly <https://github.com/johnnyreilly>. | ||
These definitions were written by [Alan Agius](https://github.com/alan-agius4), [Tanguy Krotoff](https://github.com/tkrotoff), [John Reilly](https://github.com/johnnyreilly), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16292
373