MCPcopy Create free account
hub / github.com/Effect-TS/effect / freshIdentifier

Function freshIdentifier

packages/effect/src/internal/schema/toCodeDocument.ts:261–268  ·  view source on GitHub ↗
(seed: string)

Source from the content-addressed store, hash-verified

259 }
260
261 function freshIdentifier(seed: string): string {
262 const sanitized = sanitizeJavaScriptIdentifier(seed)
263 let candidate = sanitized
264 let suffix = 0
265 while (uniqueIdentifiers.has(candidate)) candidate = `${sanitized}${++suffix}`
266 uniqueIdentifiers.add(candidate)
267 return candidate
268 }
269
270 function addImport(importDeclaration: string): void {
271 if (!artifacts.some((artifact) => artifact._tag === "Import" && artifact.importDeclaration === importDeclaration)) {

Callers 3

ensureUniqueIdentifierFunction · 0.85
addSymbolFunction · 0.85
onFunction · 0.85

Calls 3

addMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected