MCPcopy
hub / github.com/webpack/webpack / _prettyRegExp

Method _prettyRegExp

lib/ContextModule.js:225–230  ·  lib/ContextModule.js::ContextModule._prettyRegExp

* @private * @param {RegExp} regexString RegExp as a string * @param {boolean=} stripSlash do we need to strip a slsh * @returns {string} pretty RegExp

(regexString, stripSlash = true)

Source from the content-addressed store, hash-verified

223 * @returns {string} pretty RegExp
224 */
225 _prettyRegExp(regexString, stripSlash = true) {
226 const str = stripSlash
227 ? regexString.source + regexString.flags
228 : `${regexString}`;
229 return str.replace(/!/g, class="st">"%21").replace(/\|/g, class="st">"%7C");
230 }
231
232 _createIdentifier() {
233 let identifier =

Callers 3

_createIdentifierMethod · 0.95
readableIdentifierMethod · 0.95
libIdentMethod · 0.95

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected