https://github.com/andarist/regexgen.macro
🎣 Convert your set of strings to optimized RegExps at build time.
https://github.com/andarist/regexgen.macro
babel-plugin-macros
Last synced: 8 months ago
JSON representation
🎣 Convert your set of strings to optimized RegExps at build time.
- Host: GitHub
- URL: https://github.com/andarist/regexgen.macro
- Owner: Andarist
- Created: 2018-08-19T08:56:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-16T10:24:48.000Z (about 7 years ago)
- Last Synced: 2025-04-29T00:47:19.398Z (8 months ago)
- Topics: babel-plugin-macros
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 37
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# regexgen.macro
[](https://github.com/kentcdodds/babel-plugin-macros)
[](https://www.npmjs.com/package/regexgen.macro)
[](https://travis-ci.org/Andarist/regexgen.macro)
[](https://www.npmjs.com/package/regexgen.macro)
Convert your set of strings to optimized RegExps at build time with [babel macros](https://github.com/kentcdodds/babel-plugin-macros).
## Installation
```sh
npm install --save-dev regexgen.macro
```
## Usage
```js
import regexgen from 'regexgen.macro'
regexgen('children dangerouslySetInnerHTML key ref autoFocus defaultValue')
regexgen([
'children',
'dangerouslySetInnerHTML',
'key',
'ref',
'autoFocus',
'defaultValue',
])
regexgen({
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true,
autoFocus: true,
defaultValue: true,
})
```