MCPcopy Create free account
hub / github.com/simstudioai/sim / emailSpans

Function emailSpans

apps/sim/lib/guardrails/validate_pii.test.ts:24–28  ·  view source on GitHub ↗

Analyzer mock: flags `a@b.com` as EMAIL_ADDRESS when that entity is in scope.

(text: string, entities: string[] | undefined)

Source from the content-addressed store, hash-verified

22
23/** Analyzer mock: flags `a@b.com` as EMAIL_ADDRESS when that entity is in scope. */
24function emailSpans(text: string, entities: string[] | undefined): Span[] {
25 if (entities && !entities.includes('EMAIL_ADDRESS')) return []
26 const idx = text.indexOf('a@b.com')
27 return idx === -1 ? [] : [{ entity_type: 'EMAIL_ADDRESS', start: idx, end: idx + 7, score: 0.9 }]
28}
29
30describe('validate_pii (Presidio service)', () => {
31 let analyzeBodies: Array<{ text: string; language: string; entities?: string[] }>

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected