Skip to content

Commit

Permalink
Handle cases for more than 2 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
filipre committed Jul 28, 2024
1 parent 550fb65 commit 385438e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codemods/clone-regexp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function (options) {
const args = path.node.arguments;
const arg = args.length >= 1 ? [args[0]] : [];
const newRegExp = j.newExpression(j.identifier('RegExp'), arg);
if (args.length === 2) {
if (args.length >= 2) {
console.warn(
'[WARNING] Options are being passed to `clone-regexp`. Please modify the new regular expression accordingly.',
);
Expand Down

0 comments on commit 385438e

Please sign in to comment.