From f97d6e7d636bdcb8a5495c20b8b208b242e69f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E8=89=B2=E7=9A=84=E7=A7=8B=E9=A3=8E?= <461249104@qq.com> Date: Wed, 9 Oct 2019 23:28:52 +0800 Subject: [PATCH] refactor(shared): use Array literal instead of split for global whitelist Set creation (#173) --- packages/shared/src/globalsWhitelist.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/shared/src/globalsWhitelist.ts b/packages/shared/src/globalsWhitelist.ts index 97e258388..c6f69bddf 100644 --- a/packages/shared/src/globalsWhitelist.ts +++ b/packages/shared/src/globalsWhitelist.ts @@ -1,7 +1,7 @@ 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' - ).split(',') + [ + 'Infinity', 'undefined', 'NaN', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'decodeURI', + 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'Math', 'Number', 'Date', 'Array', + 'Object', 'Boolean', 'String', 'RegExp', 'Map', 'Set', 'JSON', 'Intl' + ] )