You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello I would like to use regular expression to replace a specific function call with something else.
specifically I made a function called isUndefined
which returns true if the input is not defined.
ex:
if (isUndefined(PARAM)) {
// do blah
but it appears that some browsers do not like this if PARAM has never been mentioned before
for such reasons I would like to add a build step to replace the function call with
typeof PARAM === "undefined"
the problem is that PARAM could contains parenthesis and I need it to match to the end of the matching parenthesis.
Regular expressions does have a recursive element to it. but that does not exist in javascript apparently.
So I was wondering if you had any advice on how to accomplish using your tool
Example of success:
isUndefined(funcThatMayReturnUndefined())
// changes to
typeof funcThatMayReturnUndefined() === "undefined"
The text was updated successfully, but these errors were encountered:
hello I would like to use regular expression to replace a specific function call with something else.
specifically I made a function called isUndefined
which returns true if the input is not defined.
ex:
but it appears that some browsers do not like this if PARAM has never been mentioned before
for such reasons I would like to add a build step to replace the function call with
typeof PARAM === "undefined"
the problem is that PARAM could contains parenthesis and I need it to match to the end of the matching parenthesis.
Regular expressions does have a recursive element to it. but that does not exist in javascript apparently.
So I was wondering if you had any advice on how to accomplish using your tool
Example of success:
The text was updated successfully, but these errors were encountered: