2019-10-16 00:11:08 +08:00
|
|
|
import { makeMap } from './makeMap'
|
|
|
|
|
2023-05-27 00:07:13 +08:00
|
|
|
const GLOBALS_ALLOWED =
|
2019-10-16 00:11:08 +08:00
|
|
|
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
|
|
|
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
2024-05-27 17:21:54 +08:00
|
|
|
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol'
|
2019-10-16 00:11:08 +08:00
|
|
|
|
2024-08-08 23:05:21 +08:00
|
|
|
export const isGloballyAllowed: (key: string) => boolean =
|
|
|
|
/*#__PURE__*/ makeMap(GLOBALS_ALLOWED)
|
2023-06-14 14:02:53 +08:00
|
|
|
|
|
|
|
/** @deprecated use `isGloballyAllowed` instead */
|
2024-08-08 23:05:21 +08:00
|
|
|
export const isGloballyWhitelisted: (key: string) => boolean = isGloballyAllowed
|