MCPcopy Create free account
hub / github.com/webpro-nl/knip / printCode

Function printCode

packages/docs/scripts/generate-plugin-docs.ts:20–25  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

18const tightList = (items: string[]) => items.map(item => `- ${item}`).join('\n');
19
20const printCode = (value: unknown): string =>
21 Array.isArray(value)
22 ? `[${value.map(printCode).join(', ')}]`
23 : typeof value === 'function'
24 ? value.toString()
25 : JSON.stringify(value).replace(/([,:])/g, '$1 ');
26
27for await (const dir of directories) {
28 if (dir.isDirectory() && !dir.name.startsWith('_')) {

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected