@@ -44,9 +44,9 @@ var windowAlias = window,
4444 */
4545export interface FilterCriterion < T > {
4646 /** A collection of class names to include */
47- whitelist ?: string [ ] ;
47+ allowlist ?: string [ ] ;
4848 /** A collector of class names to exclude */
49- blacklist ?: string [ ] ;
49+ denylist ?: string [ ] ;
5050 /** A callback which returns a boolean as to whether the element should be included */
5151 filter ?: ( elt : T ) => boolean ;
5252}
@@ -470,10 +470,10 @@ export function parseAndValidateFloat(obj: unknown) {
470470/**
471471 * Convert a criterion object to a filter function
472472 *
473- * @param object criterion Either {whitelist : [array of allowable strings]}
474- * or {blacklist : [array of allowable strings]}
473+ * @param object criterion Either {allowlist : [array of allowable strings]}
474+ * or {denylist : [array of allowable strings]}
475475 * or {filter: function (elt) {return whether to track the element}
476- * @param boolean byClass Whether to whitelist/blacklist based on an element's classes (for forms)
476+ * @param boolean byClass Whether to allowlist/denylist based on an element's classes (for forms)
477477 * or name attribute (for fields)
478478 */
479479export function getFilterByClass ( criterion ?: FilterCriterion < HTMLElement > | null ) : ( elt : HTMLElement ) => boolean {
@@ -484,7 +484,7 @@ export function getFilterByClass(criterion?: FilterCriterion<HTMLElement> | null
484484 } ;
485485 }
486486
487- const inclusive = Object . prototype . hasOwnProperty . call ( criterion , 'whitelist ' ) ;
487+ const inclusive = Object . prototype . hasOwnProperty . call ( criterion , 'allowlist ' ) ;
488488 const specifiedClassesSet = getSpecifiedClassesSet ( criterion ) ;
489489
490490 return getFilter ( criterion , function ( elt : HTMLElement ) {
@@ -495,8 +495,8 @@ export function getFilterByClass(criterion?: FilterCriterion<HTMLElement> | null
495495/**
496496 * Convert a criterion object to a filter function
497497 *
498- * @param object criterion Either {whitelist : [array of allowable strings]}
499- * or {blacklist : [array of allowable strings]}
498+ * @param object criterion Either {allowlist : [array of allowable strings]}
499+ * or {denylist : [array of allowable strings]}
500500 * or {filter: function (elt) {return whether to track the element}
501501 */
502502export function getFilterByName < T extends { name : string } > ( criterion : FilterCriterion < T > ) : ( elt : T ) => boolean {
@@ -507,7 +507,7 @@ export function getFilterByName<T extends { name: string }>(criterion: FilterCri
507507 } ;
508508 }
509509
510- const inclusive = criterion . hasOwnProperty ( 'whitelist ' ) ;
510+ const inclusive = criterion . hasOwnProperty ( 'allowlist ' ) ;
511511 const specifiedClassesSet = getSpecifiedClassesSet ( criterion ) ;
512512
513513 return getFilter ( criterion , function ( elt : T ) {
@@ -548,7 +548,7 @@ function getFilter<T>(criterion: FilterCriterion<T>, fallbackFilter: (elt: T) =>
548548function getSpecifiedClassesSet < T > ( criterion : FilterCriterion < T > ) {
549549 // Convert the array of classes to an object of the form {class1: true, class2: true, ...}
550550 var specifiedClassesSet : Record < string , boolean > = { } ;
551- var specifiedClasses = criterion . whitelist || criterion . blacklist ;
551+ var specifiedClasses = criterion . allowlist || criterion . denylist ;
552552
553553 if ( specifiedClasses ) {
554554 if ( ! Array . isArray ( specifiedClasses ) ) {
0 commit comments