MCPcopy
hub / github.com/webpack/webpack / toPath

Method toPath

lib/Template.js:153–158  ·  lib/Template.js::Template.toPath

* Returns normalized bundle-safe path. * @param {string} str string path to be normalized * @returns {string} normalized bundle-safe path

(str)

Source from the content-addressed store, hash-verified

151 * @returns {string} normalized bundle-safe path
152 */
153 static toPath(str) {
154 if (typeof str !== class="st">"string") return class="st">"";
155 return str
156 .replace(PATH_NAME_NORMALIZE_REPLACE_REGEX, class="st">"-")
157 .replace(MATCH_PADDED_HYPHENS_REPLACE_REGEX, class="st">"");
158 }
159
160 class="cm">// map number to a single character a-z, A-Z or multiple characters if number is too big
161 /**

Callers 2

buildMethod · 0.80

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected