MCPcopy Create free account
hub / github.com/arktypeio/arktype / writeToCsv

Function writeToCsv

ark/attest/cli/trace.ts:865–875  ·  view source on GitHub ↗
(
	filePath: string,
	headers: string[],
	rows: string[][]
)

Source from the content-addressed store, hash-verified

863}
864
865const writeToCsv = (
866 filePath: string,
867 headers: string[],
868 rows: string[][]
869): void => {
870 const content = [
871 headers.join(","),
872 ...rows.map(row => row.map(escapeForCsv).join(","))
873 ].join("\n")
874 writeFile(filePath, content)
875}
876
877const escapeForCsv = (value: string): string => {
878 if (value.includes(",") || value.includes('"') || value.includes("\n"))

Callers 1

Calls 2

writeFileFunction · 0.90
mapMethod · 0.65

Tested by

no test coverage detected