MCPcopy
hub / github.com/pydantic/pydantic / replaceText

Function replaceText

docs/extra/fluff.js:40–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 let running = false;
39
40 const replaceText = async () => {
41 if (running) {
42 return;
43 }
44 running = true;
45 try {
46 const text = el.textContent;
47 for (let i = text.length; i >= 0; i--) {
48 el.textContent = text.slice(0, i);
49 await sleep(30);
50 }
51 await sleep(30);
52 counter++;
53 // change the link halfway through the animation
54 const [link, newText] = appTypes[counter % appTypes.length];
55 el.href = docsUrl + link;
56 await sleep(30);
57 for (let i = 0; i <= newText.length; i++) {
58 el.textContent = newText.slice(0, i);
59 await sleep(30);
60 }
61 } finally {
62 running = false;
63 }
64 };
65 setInterval(replaceText, 4000);
66})();

Callers

nothing calls this directly

Calls 1

sleepFunction · 0.85

Tested by

no test coverage detected