-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
String.prototype.replace
accepts a function as second argument. Whereas this module force the second argument to be a string. There should be a check and, if "to" is of type function
, then let it be.
Example :
b.transform(browserifyReplace, {
'replace': [{
'from': LIBRARY_PATTERN_TOKENS,
'to': function (match, token, old) {
return 'lib.config["' + token + '"]';
}
}]
});
But instead of having lib.config["foo"]
, I have a .toString()
of that function.
blvz
Metadata
Metadata
Assignees
Labels
No labels