MCPcopy
hub / github.com/QwikDev/qwik / note

Function note

packages/qwik/src/cli/utils/utils.ts:225–244  ·  view source on GitHub ↗
(message = '', title = '')

Source from the content-addressed store, hash-verified

223
224const strip = (str: string) => str.replace(ansiRegex(), '');
225export const note = (message = '', title = '') => {
226 const lines = `\n${message}\n`.split('\n');
227 const titleLen = strip(title).length;
228 const len =
229 Math.max(
230 lines.reduce((sum, ln) => {
231 ln = strip(ln);
232 return ln.length > sum ? ln.length : sum;
233 }, 0),
234 titleLen
235 ) + 2;
236 const msg = lines
237 .map((ln) => `${gray(S_BAR)} ${white(ln)}${' '.repeat(len - strip(ln).length)}${gray(S_BAR)}`)
238 .join('\n');
239 process.stdout.write(
240 `${gray(S_BAR)}\n${green(S_STEP_SUBMIT)} ${reset(title)} ${gray(
241 S_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT
242 )}\n${msg}\n${gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\n`
243 );
244};
245// End of used code from clack

Callers 7

printHelpFunction · 0.90
printNewHelpFunction · 0.90
runJokeCommandFunction · 0.90
printAddHelpFunction · 0.90
logUpdateAppCommitResultFunction · 0.90
runCreateInteractiveCliFunction · 0.90
logAppCreatedFunction · 0.90

Calls 2

stripFunction · 0.85
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…