MCPcopy
hub / github.com/remix-run/react-router / clear

Function clear

packages/create-react-router/utils.ts:237–246  ·  view source on GitHub ↗
(prompt: string, perLine: number)

Source from the content-addressed store, hash-verified

235}
236
237export function clear(prompt: string, perLine: number) {
238 if (!perLine) return erase.line + cursor.to(0);
239 let rows = 0;
240 let lines = prompt.split(/\r?\n/);
241 for (let line of lines) {
242 rows += 1 + Math.floor(Math.max(strip(line).length - 1, 0) / perLine);
243 }
244
245 return erase.lines(rows);
246}
247
248export function lines(msg: string, perLine: number) {
249 let lines = String(strip(msg) || "").split(/\r?\n/);

Callers 5

constructorMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90

Calls 1

stripFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…