MCPcopy Create free account
hub / github.com/code-pushup/cli / singleQuote

Function singleQuote

packages/utils/src/lib/formatting.ts:201–207  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

199
200/** Escapes a string and wraps it in single quotes for use in JS code. */
201export function singleQuote(value: string): string {
202 const inner = JSON.stringify(value)
203 .slice(1, -1)
204 .replace(/\\"/g, '"')
205 .replace(/'/g, String.raw`\'`);
206 return `'${inner}'`;
207}

Callers 11

formatPluginInitFunction · 0.90
formatPluginInitFunction · 0.90
addCategoriesFunction · 0.90
createCategoriesFunction · 0.90
formatUrlsFunction · 0.90
formatPluginInitFunction · 0.90
formatPluginInitFunction · 0.90
formatPluginInitFunction · 0.90
formatPluginCallFunction · 0.90
formatUrlsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected