MCPcopy Index your code
hub / github.com/webpack/css-loader / escapeLocalIdent

Function escapeLocalIdent

src/utils.js:267–277  ·  view source on GitHub ↗
(localident)

Source from the content-addressed store, hash-verified

265const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g;
266
267function escapeLocalIdent(localident) {
268 // TODO simplify?
269 return escape(
270 localident
271 // For `[hash]` placeholder
272 .replace(/^((-?[0-9])|--)/, "_$1")
273 .replace(filenameReservedRegex, "-")
274 .replace(reControlChars, "-")
275 .replace(/\./g, "-"),
276 );
277}
278
279function defaultGetLocalIdent(
280 loaderContext,

Callers 1

generateScopedNameFunction · 0.85

Calls 1

escapeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…