<commit_before>espurify
================================

Clone new AST without extra properties

[![Build Status](https://travis-ci.org/estools/espurify.svg?branch=master)](https://travis-ci.org/estools/espurify)
[![NPM version](https://badge.fury.io/js/espurify.svg)](https://badge.fury.io/js/espurify)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/estools/espurify/blob/master/MIT-LICENSE.txt)


API
---------------------------------------

### var purifiedAstClone = espurify(originalAst)

Returns new clone of `originalAst` but without extra properties.

Leaves properties defined in [The ESTree Spec](https://github.com/estree/estree) (formerly known as [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API)) only. Also note that extra informations (such as `loc`, `range` and `raw`) are eliminated too.

`espurify` supports [ES5](https://github.com/estree/estree/blob/master/spec.md) and [ES6](https://github.com/estree/estree/blob/master/es6.md) properties.


### var customizedCloneFunctionWithWhiteList = espurify.cloneWithWhitelist(whiteList)

Returns customized function for cloning AST, with user-provided `whiteList`.


### var purifiedAstClone = customizedCloneFunctionWithWhiteList(originalAst)

Returns new clone of `originalAst` by customized function.


#### whiteList

| type     | default value |
|:---------|:--------------|
| `object` | N/A           |<commit_msg>docs(README): refer to ES2017<commit_after>espurify
================================

Clone new AST without extra properties

[![Build Status](https://travis-ci.org/estools/espurify.svg?branch=master)](https://travis-ci.org/estools/espurify)
[![NPM version](https://badge.fury.io/js/espurify.svg)](https://badge.fury.io/js/espurify)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/estools/espurify/blob/master/MIT-LICENSE.txt)


API
---------------------------------------

### var purifiedAstClone = espurify(originalAst)

Returns new clone of `originalAst` but without extra properties.

Leaves properties defined in [The ESTree Spec](https://github.com/estree/estree) (formerly known as [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API)) only. Also note that extra informations (such as `loc`, `range` and `raw`) are eliminated too.

`espurify` supports [ES5](https://github.com/estree/estree/blob/master/es5.md), [ES2015](https://github.com/estree/estree/blob/master/es2015.md), and [ES2017](https://github.com/estree/estree/blob/master/es2017.md) properties.


### var customizedCloneFunctionWithWhiteList = espurify.cloneWithWhitelist(whiteList)

Returns customized function for cloning AST, with user-provided `whiteList`.


### var purifiedAstClone = customizedCloneFunctionWithWhiteList(originalAst)

Returns new clone of `originalAst` by customized function.


#### whiteList

| type     | default value |
|:---------|:--------------|
| `object` | N/A           |
{'fraction_non_alphanumeric': 0.19888231426692965, 'fraction_numerical': 0.00821827744904668, 'mean_word_length': 4.246551724137931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 21, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '271790', 'n_tokens_mistral': 1000, 'n_tokens_neox': 933, 'n_words': 182}