cloudworker-proxy
Version:
An api gateway for cloudflare workers
11 lines (10 loc) • 443 B
JavaScript
var replaceall = function (replaceThis, withThis, inThis) {
withThis = withThis.replace(/\$/g,"$$$$");
return inThis.replace(new RegExp(replaceThis.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|<>\-\&])/g,"\\$&"),"g"), withThis);
};
if (typeof (exports) !== "undefined") {
if (typeof (module) !== "undefined" && module.exports) {
exports = module.exports = replaceall;
}
exports.replaceall = replaceall;
}