-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.js
30 lines (27 loc) · 892 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* espurify - Clone AST without extra properties
*
* https://github.com/estools/espurify
*
* Copyright (c) 2014-2024 Takuto Wada
* Licensed under the MIT license.
* https://github.com/estools/espurify/blob/master/MIT-LICENSE.txt
*/
'use strict';
const createAllowlist = require('./lib/create-allowlist');
const cloneWithAllowlist = require('./lib/clone-ast');
function createCloneFunction (options) {
return cloneWithAllowlist(createAllowlist(options));
}
/**
* @deprecated since version 3.0.0. Use `espurify.purifyAst` instead.
*/
const espurify = createCloneFunction();
espurify.purifyAst = createCloneFunction();
espurify.customize = createCloneFunction;
espurify.cloneWithAllowlist = cloneWithAllowlist;
/**
* @deprecated since version 3.0.0. Use `espurify.cloneWithAllowlist` instead.
*/
espurify.cloneWithWhitelist = cloneWithAllowlist;
module.exports = espurify;