@@ -38,24 +38,24 @@ function userCheckIgnore(logger) {
3838 }
3939}
4040
41- function urlIsNotBlacklisted ( logger ) {
41+ function urlIsNotBlockListed ( logger ) {
4242 return function ( item , settings ) {
43- return ! urlIsOnAList ( item , settings , 'blacklist ' , logger ) ;
43+ return ! urlIsOnAList ( item , settings , 'blocklist ' , logger ) ;
4444 }
4545}
4646
47- function urlIsWhitelisted ( logger ) {
47+ function urlIsSafeListed ( logger ) {
4848 return function ( item , settings ) {
49- return urlIsOnAList ( item , settings , 'whitelist ' , logger ) ;
49+ return urlIsOnAList ( item , settings , 'safelist ' , logger ) ;
5050 }
5151}
5252
53- function matchFrames ( trace , list , black ) {
54- if ( ! trace ) { return ! black }
53+ function matchFrames ( trace , list , block ) {
54+ if ( ! trace ) { return ! block }
5555
5656 var frames = trace . frames ;
5757
58- if ( ! frames || frames . length === 0 ) { return ! black ; }
58+ if ( ! frames || frames . length === 0 ) { return ! block ; }
5959
6060 var frame , filename , url , urlRegex ;
6161 var listLength = list . length ;
@@ -64,7 +64,7 @@ function matchFrames(trace, list, black) {
6464 frame = frames [ i ] ;
6565 filename = frame . filename ;
6666
67- if ( ! _ . isType ( filename , 'string' ) ) { return ! black ; }
67+ if ( ! _ . isType ( filename , 'string' ) ) { return ! block ; }
6868
6969 for ( var j = 0 ; j < listLength ; j ++ ) {
7070 url = list [ j ] ;
@@ -78,44 +78,44 @@ function matchFrames(trace, list, black) {
7878 return false ;
7979}
8080
81- function urlIsOnAList ( item , settings , whiteOrBlack , logger ) {
82- // whitelist is the default
83- var black = false ;
84- if ( whiteOrBlack === 'blacklist ' ) {
85- black = true ;
81+ function urlIsOnAList ( item , settings , safeOrBlock , logger ) {
82+ // safelist is the default
83+ var block = false ;
84+ if ( safeOrBlock === 'blocklist ' ) {
85+ block = true ;
8686 }
8787
8888 var list , traces ;
8989 try {
90- list = black ? settings . hostBlackList : settings . hostWhiteList ;
90+ list = block ? settings . hostBlockList : settings . hostSafeList ;
9191 traces = _ . get ( item , 'body.trace_chain' ) || [ _ . get ( item , 'body.trace' ) ] ;
9292
9393 // These two checks are important to come first as they are defaults
9494 // in case the list is missing or the trace is missing or not well-formed
9595 if ( ! list || list . length === 0 ) {
96- return ! black ;
96+ return ! block ;
9797 }
9898 if ( traces . length === 0 || ! traces [ 0 ] ) {
99- return ! black ;
99+ return ! block ;
100100 }
101101
102102 var tracesLength = traces . length ;
103103 for ( var i = 0 ; i < tracesLength ; i ++ ) {
104- if ( matchFrames ( traces [ i ] , list , black ) ) {
104+ if ( matchFrames ( traces [ i ] , list , block ) ) {
105105 return true ;
106106 }
107107 }
108108 } catch ( e )
109109 /* istanbul ignore next */
110110 {
111- if ( black ) {
112- settings . hostBlackList = null ;
111+ if ( block ) {
112+ settings . hostBlockList = null ;
113113 } else {
114- settings . hostWhiteList = null ;
114+ settings . hostSafeList = null ;
115115 }
116- var listName = black ? 'hostBlackList ' : 'hostWhiteList ' ;
116+ var listName = block ? 'hostBlockList ' : 'hostSafeList ' ;
117117 logger . error ( 'Error while reading your configuration\'s ' + listName + ' option. Removing custom ' + listName + '.' , e ) ;
118- return ! black ;
118+ return ! block ;
119119 }
120120 return false ;
121121}
@@ -167,7 +167,7 @@ function messageIsIgnored(logger) {
167167module . exports = {
168168 checkLevel : checkLevel ,
169169 userCheckIgnore : userCheckIgnore ,
170- urlIsNotBlacklisted : urlIsNotBlacklisted ,
171- urlIsWhitelisted : urlIsWhitelisted ,
170+ urlIsNotBlockListed : urlIsNotBlockListed ,
171+ urlIsSafeListed : urlIsSafeListed ,
172172 messageIsIgnored : messageIsIgnored
173173} ;
0 commit comments