-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support to string in includes #1
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request @alisonrag, I'll be reviewing your commits these days to include them in the codebase. |
@@ -143,7 +143,7 @@ const evalLiteral = node => { | |||
assert.strictEqual(node.type, NODE_LITERAL); | |||
|
|||
const { value } = node; | |||
const typeNames = [TYPE_NUMBER, TYPE_BOOLEAN, TYPE_STRING]; | |||
const typeNames = [TYPE_NUMBER, TYPE_BOOLEAN, TYPE_STRING, TYPE_OBJECT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove TYPE_OBJECT
from typeNames
since it would be an error if a node of type NODE_LITERAL
has an object as value.
}, | ||
matchAll: (target, context, options, runState) => { | ||
const pattern = context.get('pattern'); | ||
return target.match(pattern); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please call matchAll
instead.
return target.replace( | ||
searchValue, | ||
newValue instanceof AbstractFunction ? | ||
(x) => newValue.exec(x, context, options, runState) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exec
method requires the first argument to be an array of parameters. Please fix the code to pass in all the arguments to the replacer function.
return target.replaceAll( | ||
searchValue, | ||
newValue instanceof AbstractFunction ? | ||
(x) => newValue.exec(x, context, options, runState) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exec
method requires the first argument to be an array of parameters. Please fix the code to pass in all the arguments to the replacer function.
No description provided.