MCPcopy
hub / github.com/webpack/webpack / toIdentifier

Method toIdentifier

lib/Template.js:121–126  ·  view source on GitHub ↗

* Returns created identifier. * @param {string} str the string converted to identifier * @returns {string} created identifier

(str)

Source from the content-addressed store, hash-verified

119 * @returns {string} created identifier
120 */
121 static toIdentifier(str) {
122 if (typeof str !== "string") return "";
123 return str
124 .replace(IDENTIFIER_NAME_REPLACE_REGEX, "_$1")
125 .replace(IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX, "_");
126 }
127
128 /**
129 * Returns a commented version of string.

Callers 12

constructorMethod · 0.80
renderStartupMethod · 0.80
renderMethod · 0.80
externalsArgumentsMethod · 0.80
renderMethod · 0.80
renderMethod · 0.80
generateExportCodeMethod · 0.80
getImportVarMethod · 0.80
findNewNameFunction · 0.80
applyOutputDefaultsFunction · 0.80

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected