Comparing version 4.4.3 to 4.5.0
# Changelog | ||
## v4.5.0 | ||
- Inlining has been improved | ||
- An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed | ||
- You can now set the ES version through their year | ||
- The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such | ||
- Internal small optimisations and refactors | ||
## v4.4.3 | ||
@@ -4,0 +12,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "4.4.3", | ||
"version": "4.5.0", | ||
"engines": { | ||
@@ -10,0 +10,0 @@ "node": ">=6.0.0" |
@@ -5,3 +5,4 @@ <h1><img src="https://terser.org/img/terser-banner-logo.png" alt="Terser" width="400"></h1> | ||
[![NPM Downloads][downloads-image]][downloads-url] | ||
[![Linux Build][travis-image]][travis-url] | ||
[![Travis Build][travis-image]][travis-url] | ||
[![Opencollective financial contributors][opencollective-contributors]][opencollective-url] | ||
@@ -26,2 +27,4 @@ A JavaScript parser and mangler/compressor toolkit for ES6+. | ||
[travis-url]: https://travis-ci.org/terser/terser | ||
[opencollective-contributors]: https://opencollective.com/terser/tiers/badge.svg | ||
[opencollective-url]: https://opencollective.com/terser | ||
@@ -536,3 +539,3 @@ Why choose terser? | ||
- `ecma` (default `undefined`) - pass `5`, `6`, `7` or `8` to override `parse`, | ||
- `ecma` (default `undefined`) - pass `5`, `2015`, `2016` or `2017` to override `parse`, | ||
`compress` and `output`'s `ecma` options. | ||
@@ -614,3 +617,3 @@ | ||
}, | ||
ecma: 5, // specify one of: 5, 6, 7 or 8 | ||
ecma: 5, // specify one of: 5, 2015, 2016, 2017 or 2018 | ||
keep_classnames: false, | ||
@@ -680,5 +683,5 @@ keep_fnames: false, | ||
- `ecma` (default: `8`) -- specify one of `5`, `6`, `7` or `8`. Note: this setting | ||
- `ecma` (default: `2017`) -- specify one of `5`, `2015`, `2016` or `2017`. Note: this setting | ||
is not presently enforced except for ES8 optional trailing commas in function | ||
parameter lists and calls with `ecma` `8`. | ||
parameter lists and calls with `ecma` `2017`. | ||
@@ -691,5 +694,6 @@ - `html5_comments` (default `true`) | ||
- `arrows` (default: `true`) -- Converts `()=>{return x}` to `()=>x`. Class | ||
and object literal methods will also be converted to arrow expressions if | ||
the resultant code is shorter: `m(){return x}` becomes `m:()=>x`. | ||
- `arrows` (default: `true`) -- Class and object literal methods are converted | ||
will also be converted to arrow expressions if the resultant code is shorter: | ||
`m(){return x}` becomes `m:()=>x`. To do this to regular ES5 functions which | ||
don't use `this` or `arguments`, see `unsafe_arrows`. | ||
@@ -733,3 +737,3 @@ - `arguments` (default: `false`) -- replace `arguments[index]` with function | ||
- `ecma` (default: `5`) -- Pass `6` or greater to enable `compress` options that | ||
- `ecma` (default: `5`) -- Pass `2015` or greater to enable `compress` options that | ||
will transform ES5 code into smaller ES6+ equivalent forms. | ||
@@ -856,3 +860,3 @@ | ||
the function having a `prototype`, which arrow functions lack. | ||
This transform requires that the `ecma` compress option is set to `6` or greater. | ||
This transform requires that the `ecma` compress option is set to `2015` or greater. | ||
@@ -992,3 +996,3 @@ - `unsafe_comps` (default: `false`) -- Reverse `<` and `<=` to `>` and `>=` to | ||
- `ecma` (default `5`) -- set output printing mode. Set `ecma` to `6` or | ||
- `ecma` (default `5`) -- set output printing mode. Set `ecma` to `2015` or | ||
greater to emit shorthand object properties - i.e.: `{a}` instead of `{a: a}`. | ||
@@ -1007,2 +1011,5 @@ The `ecma` option will only change the output in direct control of the | ||
- `keep_numbers` (default `false`) -- keep number literals as it was in original code | ||
(disables optimizations like converting `1000000` into `1e6`) | ||
- `keep_quoted_props` (default `false`) -- when turned on, prevents stripping | ||
@@ -1009,0 +1016,0 @@ quotes from property names in object literals. |
@@ -5,4 +5,7 @@ /// <reference lib="es2015" /> | ||
export type ECMA = 5 | 6 | 7 | 8 | 9; | ||
/** @deprecated since this versions basically do not exist */ | ||
type ECMA_UNOFFICIAL = 6 | 7 | 8 | 9; | ||
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | ECMA_UNOFFICIAL; | ||
export interface ParseOptions { | ||
@@ -9,0 +12,0 @@ bare_returns?: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1718063
17
7632
1389