mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
17 lines
424 B
TypeScript
17 lines
424 B
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/helpers/multilineRegex.ts
|
|
|
|
|
|
/**
|
|
* Build RegExp object from an array
|
|
* of multiple/multi-line regexp parts
|
|
*
|
|
* @param {string[]} parts
|
|
* @param {string} flags
|
|
* @return {object} - RegExp object
|
|
*/
|
|
export const multilineRegexp = (parts: string[], flags = '') => {
|
|
const regexpAsStringLiteral = parts.join('');
|
|
|
|
return new RegExp(regexpAsStringLiteral, flags);
|
|
};
|