@@ -21,7 +21,7 @@ const buildUmdWrapper = replacements =>
2121 });
2222 ` ( replacements ) ;
2323
24- function buildGlobal ( whitelist ) {
24+ function buildGlobal ( allowlist ) {
2525 const namespace = t . identifier ( "babelHelpers" ) ;
2626
2727 const body = [ ] ;
@@ -60,14 +60,14 @@ function buildGlobal(whitelist) {
6060 ] ) ,
6161 ) ;
6262
63- buildHelpers ( body , namespace , whitelist ) ;
63+ buildHelpers ( body , namespace , allowlist ) ;
6464
6565 return tree ;
6666}
6767
68- function buildModule ( whitelist ) {
68+ function buildModule ( allowlist ) {
6969 const body = [ ] ;
70- const refs = buildHelpers ( body , null , whitelist ) ;
70+ const refs = buildHelpers ( body , null , allowlist ) ;
7171
7272 body . unshift (
7373 t . exportNamedDeclaration (
@@ -81,7 +81,7 @@ function buildModule(whitelist) {
8181 return t . program ( body , [ ] , "module" ) ;
8282}
8383
84- function buildUmd ( whitelist ) {
84+ function buildUmd ( allowlist ) {
8585 const namespace = t . identifier ( "babelHelpers" ) ;
8686
8787 const body = [ ] ;
@@ -91,7 +91,7 @@ function buildUmd(whitelist) {
9191 ] ) ,
9292 ) ;
9393
94- buildHelpers ( body , namespace , whitelist ) ;
94+ buildHelpers ( body , namespace , allowlist ) ;
9595
9696 return t . program ( [
9797 buildUmdWrapper ( {
@@ -109,7 +109,7 @@ function buildUmd(whitelist) {
109109 ] ) ;
110110}
111111
112- function buildVar ( whitelist ) {
112+ function buildVar ( allowlist ) {
113113 const namespace = t . identifier ( "babelHelpers" ) ;
114114
115115 const body = [ ] ;
@@ -119,12 +119,12 @@ function buildVar(whitelist) {
119119 ] ) ,
120120 ) ;
121121 const tree = t . program ( body ) ;
122- buildHelpers ( body , namespace , whitelist ) ;
122+ buildHelpers ( body , namespace , allowlist ) ;
123123 body . push ( t . expressionStatement ( namespace ) ) ;
124124 return tree ;
125125}
126126
127- function buildHelpers ( body , namespace , whitelist ) {
127+ function buildHelpers ( body , namespace , allowlist ) {
128128 const getHelperReference = name => {
129129 return namespace
130130 ? t . memberExpression ( namespace , t . identifier ( name ) )
@@ -133,7 +133,7 @@ function buildHelpers(body, namespace, whitelist) {
133133
134134 const refs = { } ;
135135 helpers . list . forEach ( function ( name ) {
136- if ( whitelist && whitelist . indexOf ( name ) < 0 ) return ;
136+ if ( allowlist && allowlist . indexOf ( name ) < 0 ) return ;
137137
138138 const ref = ( refs [ name ] = getHelperReference ( name ) ) ;
139139
@@ -145,7 +145,7 @@ function buildHelpers(body, namespace, whitelist) {
145145 return refs ;
146146}
147147export default function (
148- whitelist ?: Array < string > ,
148+ allowlist ?: Array < string > ,
149149 outputType : "global" | "module" | "umd" | "var" = "global" ,
150150) {
151151 let tree ;
@@ -158,7 +158,7 @@ export default function (
158158 } [ outputType ] ;
159159
160160 if ( build ) {
161- tree = build ( whitelist ) ;
161+ tree = build ( allowlist ) ;
162162 } else {
163163 throw new Error ( `Unsupported output type ${ outputType } ` ) ;
164164 }
0 commit comments