MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / isTextWithSubstance

Function isTextWithSubstance

lib/embed-docs/utils.ts:4–15  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

2import { getTokenCount, isDate, isEmail, isPhoneNumber, isUrl } from "../utils";
3
4export function isTextWithSubstance(text: string): boolean {
5 return (
6 // Hack to include multi-line images or links
7 ["[", "!["].includes(text) ||
8 // If very short number of characters, likely it's not a useful chunk
9 (text.length > 3 &&
10 !isEmail(text) &&
11 !isPhoneNumber(text) &&
12 !isUrl(text) &&
13 !isDate(text))
14 );
15}
16
17export function splitTextByHeaders(
18 markdownText: string,

Callers 2

getUrlText.test.tsFile · 0.90
splitIntoTextChunksFunction · 0.85

Calls 4

isEmailFunction · 0.90
isPhoneNumberFunction · 0.90
isUrlFunction · 0.90
isDateFunction · 0.90

Tested by

no test coverage detected