3.1.0 (2024-07-04)
- Support ES2023 and ES2024 (a03f0b2e)
3.0.0 (2022-07-17)
-
Provide ecmaVersion option to make cloned AST conform to each annual estree spec
- set default ecmaVersion to 2022
-
Introduce
espurify.purifyAst
as an alias of default function -
Rename all WhiteList to AllowList in favor of more inclusive language
-
- support PropertyDefinition
- support PrivateIdentifier
- support StaticBlock
-
- support ChainExpression
- support ImportExpression
- support exported property of ExportAllDeclaration
- support BigInt literals
This release will not affect most users immediately. There are three notable changes.
-
espurify
function is still exported as default but deprecated in favor of named exports aiming ESM era, and will be removed in future major releases. Please useespurify.purifyAst
instead. -
espurify.cloneWithWhitelist
is still exported but deprecated in favor of more inclusive language and will be removed in future major releases. Please useespurify.cloneWithAllowlist
instead. -
Some new properties will appear in purified AST and may affect deep-equality of the tree, since default ecmaVersion is changed from 2018 to 2022 which add some properties to existing Nodes.
- CallExpression: ['type', 'callee', 'arguments'],
+ CallExpression: ['type', 'callee', 'arguments', 'optional'],
- ExportAllDeclaration: ['type', 'source'],
+ ExportAllDeclaration: ['type', 'source', 'exported'],
- Literal: ['type', 'value', 'regex'],
+ Literal: ['type', 'value', 'regex', 'bigint'],
To make espurify's behavior same as v2, please use espurify.customize
function with ecmaVersion: 2018
option.
const purify = espurify.customize({ ecmaVersion: 2018 });
const clonedAst = purify(originalAst);
2.1.1 (2021-03-29)
- Revert relase 2.1.0 since it affects to AST matching logic and breaks some usecases.
2.1.0 (2021-03-26)
- Support ES2020 grammar
- support ChainExpression
- support ImportExpression
- support exported property of ExportAllDeclaration
- support BigInt literals
2.0.1 (2019-02-15)
- Fix cloning when the same object instance is referenced from multiple nodes (and introduce structural cloning) by @papandreou
2.0.0 (2018-11-23)
We drop support of ancient (= before ES6) environments. Please use polyfills by your own.
We stopped providing prebuilt bundle for browsers. Please build your own by your bundler. We also dropped bower support. Please use npm instead.
1.8.1 (2018-07-10)
1.8.0 (2018-05-10)
1.7.0 (2017-02-24)
1.6.1 (2017-02-13)
- fix property order of ConditionalExpression (01c13ada)
1.6.0 (2016-05-25)
1.5.1 (2016-03-28)
1.5.0 (2015-12-21)
- prepend
type
to whitelist if it does not exist (af941315)
1.4.0 (2015-12-18)
1.3.0 (2015-06-05)
- add
delegate
to YieldExpression (8ef733ed)
1.2.0 (2015-04-17)
1.1.0 (2015-04-12)
- switch to The ESTree Spec to support ES6 (b9ca486e)
- avoid cloning private (maybe recursive) props (501b12bf)
1.0.1 (2015-03-06)
- replace Array#indexOf with indexof module to deal with older browsers (4ba0bd51)
- ship browser build with npm module too (47e0cc85)
Moved repository from twada/espurify to estools/espurify.
1.0.0 (2014-11-01)
The first stable release.
0.1.3 (2014-08-01)
0.1.2 (2014-07-22)
0.1.1 (2014-07-22)
0.1.0 (2014-07-22)
The first release.