regex-from-extensions
v1.0.0
Published
Get a regex expression from a list of extensions. Useful with webpack's `test` property.
Downloads
3
Maintainers
Readme
Regex from Extensions
Get a regex expression from a list of extensions. Useful with webpack's test
property.
Example
const regexFromExtensions = require('regex-from-extensions');
// resolves to /\.(js|jsx|ts|tsx)$/
regexFromExtensions(['js', 'jsx', 'ts', 'tsx']);
Syntax
regexFromExtensions(array)
License
MIT