UNPKG

usepages-render-blocks

Version:
75 lines (72 loc) 954 B
const RESERVED = [ 'break', 'case', 'class', 'catch', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'new', 'return', 'super', 'switch', 'this', 'throw', 'try', 'var', 'void', 'while', 'with', 'yield', '=>', 'abstract', 'boolean', 'byte', 'char', 'double', 'final', 'float', 'goto', 'int', 'long', 'native', 'short', 'synchronized', 'throws', 'transient', 'volatile', 'async', 'await', 'implements', 'package', 'protected', 'static', 'let', 'interface', 'private', 'public', 'Boolean', 'Number', 'RegExp', 'String' ].map(w => `\\s+${w}\\s+|^${w}$|\\s+${w}$|^${w}\\s+`).join('|'); const SYMBOLS = [ ';', '\\(', '\\)', 'window', '[\\s+|\\w+]=[\\s+|\\w+]' ].join('|'); export default new RegExp(`${RESERVED}|${SYMBOLS}`, 'i');