How to use the replaceAll function from underscore.string
Find comprehensive JavaScript underscore.string.replaceAll code examples handpicked from public code repositorys.
74 75 76 77 78 79 80 81 82 83 84app.use(function* (next) { var start = new Date(); var tags = []; var cleanMethod = _s.strLeftBack(this.url, '?'); cleanMethod = _s.replaceAll(cleanMethod, '/', '_'); cleanMethod = _s.trim(cleanMethod, '_'); cleanMethod = this.method + '.' + cleanMethod; cleanMethod = cleanMethod.toLowerCase(); tags.push('endpoint:' + cleanMethod);
+ 2 other calls in file
8 9 10 11 12 13 14 15 16 17 18function replaceProjectFile(conf) { let buf = fs.readFileSync(conf.targetProj, 'utf-8'); switch (conf.runtimeLibrary) { case 'MultiThreadedDebugDLL': buf = s.replaceAll(buf, /(<RuntimeLibrary>)(MultiThreadedDebug)(<\/RuntimeLibrary>)/, `$1${conf.runtimeLibrary}$3`); break; case 'MultiThreadedDLL': buf = s.replaceAll(buf, /(<RuntimeLibrary>)(MultiThreaded)(<\/RuntimeLibrary>)/, `$1${conf.runtimeLibrary}$3`); break;
+ 3 other calls in file
5 6 7 8 9 10 11 12 13 14 15 16const buildOneConf = require('./build-one-conf'); const s = require('underscore.string'); function replaceOutputFile(proj) { let buf = fs.readFileSync(proj.targetProj, 'utf-8'); buf = s.replaceAll(buf, /<OutputFile>.*<\/OutputFile>/, '<OutputFile>$(OutDir)$(TargetName)$(TargetExt)<\/OutputFile>'); fs.writeFileSync(proj.targetProj, buf); } function getTargetName(proj) {
68 69 70 71 72 73 74 75 76 77function x5Quote(uri) { var ret = encodeURIComponent(uri); ret = s.replaceAll(ret, "!", "%21"); ret = s.replaceAll(ret, "'", "%27"); ret = s.replaceAll(ret, "\\(", "%28"); ret = s.replaceAll(ret, "\\)", "%29"); ret = s.replaceAll(ret, "\\*", "%2A"); return ret; }
+ 4 other calls in file
underscore.string.slugify is the most popular function in underscore.string (323 examples)