MCPcopy
hub / github.com/formatjs/formatjs / outputDelimiter

Function outputDelimiter

tools/release-please/github-output.ts:1–14  ·  view source on GitHub ↗
(key: string, value: string)

Source from the content-addressed store, hash-verified

1function outputDelimiter(key: string, value: string): string {
2 const normalizedKey = key.replace(/[^A-Za-z0-9_]/g, '_')
3 const baseDelimiter = `FORMATJS_${normalizedKey}_EOF`
4 const lines = new Set(value.split(/\r?\n/))
5 let delimiter = baseDelimiter
6 let suffix = 0
7
8 while (lines.has(delimiter)) {
9 suffix++
10 delimiter = `${baseDelimiter}_${suffix}`
11 }
12
13 return delimiter
14}
15
16export function githubOutputRecord(key: string, value): string {
17 const serialized = typeof value === 'string' ? value : JSON.stringify(value)

Callers 1

githubOutputRecordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected