refactor(core): use makeMap for faster string match checks (#282)
This commit is contained in:
@@ -1,25 +1,8 @@
|
||||
export const globalsWhitelist = new Set([
|
||||
'Infinity',
|
||||
'undefined',
|
||||
'NaN',
|
||||
'isFinite',
|
||||
'isNaN',
|
||||
'parseFloat',
|
||||
'parseInt',
|
||||
'decodeURI',
|
||||
'decodeURIComponent',
|
||||
'encodeURI',
|
||||
'encodeURIComponent',
|
||||
'Math',
|
||||
'Number',
|
||||
'Date',
|
||||
'Array',
|
||||
'Object',
|
||||
'Boolean',
|
||||
'String',
|
||||
'RegExp',
|
||||
'Map',
|
||||
'Set',
|
||||
'JSON',
|
||||
'Intl'
|
||||
])
|
||||
import { makeMap } from './makeMap'
|
||||
|
||||
const GLOBALS_WHITE_LISTED =
|
||||
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
||||
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
||||
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl'
|
||||
|
||||
export const isGloballyWhitelisted = makeMap(GLOBALS_WHITE_LISTED)
|
||||
|
||||
Reference in New Issue
Block a user