Skip to content

Commit

Permalink
🚨 Fix linter warning about RegExp
Browse files Browse the repository at this point in the history
```
standard: Use JavaScript Standard Style (https://standardjs.com)
  /home/runner/work/rfdc/rfdc/test/index.js:124:25: Use a regular expression literal instead of the 'RegExp' constructor. (prefer-regex-literals)
```
  • Loading branch information
alecgibson committed Jun 12, 2024
1 parent f08c7ec commit 075a0cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ test('custom constructor handler', async ({ same, ok, isNot }) => {
isNot(cloned.foo, data.foo, 'different objects')
})
test('custom RegExp handler', async ({ same, ok, isNot }) => {
const data = { regex: new RegExp('foo') }
const data = { regex: /foo/ }
const cloned = rfdc({ constructorHandlers: [[RegExp, (o) => new RegExp(o)]] })(data)
isNot(cloned.regex, data.regex, 'different objects')
ok(cloned.regex.test('foo'))
Expand Down

0 comments on commit 075a0cc

Please sign in to comment.