MCPcopy Create free account
hub / github.com/webpack/css-loader / convertToTemplateLiteral

Function convertToTemplateLiteral

src/utils.js:1104–1117  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1102const DOLLAR = "$".charCodeAt(0);
1103
1104function convertToTemplateLiteral(str) {
1105 let escapedString = "";
1106
1107 for (let i = 0; i < str.length; i++) {
1108 const code = str.charCodeAt(i);
1109
1110 escapedString +=
1111 code === SLASH || code === BACKTICK || code === DOLLAR
1112 ? `\\${str[i]}`
1113 : str[i];
1114 }
1115
1116 return `\`${escapedString}\``;
1117}
1118
1119function dashesCamelCase(str) {
1120 return str.replace(/-+(\w)/g, (match, firstLetter) =>

Callers 2

getModuleCodeFunction · 0.85
addExportToLocalsCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…