This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function verboseRegExp(input) { | |
if (input.raw.length !== 1) { | |
throw Error('verboseRegExp: interpolation is not supported'); | |
} | |
let source = input.raw[0]; | |
let regexp = /(?<!\\)\s|[/][/].*|[/][*][\s\S]*[*][/]/g; | |
let result = source.replace(regexp, ''); |