MCPcopy
hub / github.com/tone-row/flowchart-fun / generateDuration

Function generateDuration

app/src/components/EditWithAI.tsx:299–305  ·  view source on GitHub ↗

* Pick a reading duration in milliseconds based on the length of the text.

(text: string)

Source from the content-addressed store, hash-verified

297 * Pick a reading duration in milliseconds based on the length of the text.
298 */
299function generateDuration(text: string) {
300 const words = text.split(/\s+/).length;
301 const wordsPerMinute = 200;
302 const minutes = words / wordsPerMinute;
303 const duration = minutes * 60 * 1000;
304 return Math.max(duration, 4000);
305}

Callers 1

EditWithAIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected