UNPKG

create-fastify-app

Version:
14 lines (11 loc) 233 B
'use strict' const arrayToRegExp = (arr) => { const reg = arr.map((file) => { if (/^\./.test(file)) { return `\\${file}` } return file }).join('|') return new RegExp(`(${reg})`) } module.exports = { arrayToRegExp }