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

Function formatPluginCall

packages/plugin-axe/src/lib/binding.ts:128–139  ·  view source on GitHub ↗
({ urls, preset, setupScript }: AxeOptions)

Source from the content-addressed store, hash-verified

126}
127
128function formatPluginCall({ urls, preset, setupScript }: AxeOptions): string {
129 const formattedUrls = formatUrls(urls);
130 const options = [
131 preset !== AXE_DEFAULT_PRESET && `preset: ${singleQuote(preset)}`,
132 setupScript && `setupScript: ${singleQuote(SETUP_SCRIPT_PATH)}`,
133 ].filter(Boolean);
134
135 if (options.length === 0) {
136 return `axePlugin(${formattedUrls})`;
137 }
138 return `axePlugin(${formattedUrls}, { ${options.join(', ')} })`;
139}
140
141function formatUrls([first, ...rest]: [string, ...string[]]): string {
142 if (rest.length === 0) {

Callers 1

binding.tsFile · 0.70

Calls 2

singleQuoteFunction · 0.90
formatUrlsFunction · 0.70

Tested by

no test coverage detected