MCPcopy
hub / github.com/vitejs/vite / codegenSimpleObject

Function codegenSimpleObject

packages/vite/src/node/plugins/wasm.ts:285–292  ·  view source on GitHub ↗
(obj: SimpleObject)

Source from the content-addressed store, hash-verified

283}
284
285function codegenSimpleObject(obj: SimpleObject): string {
286 if (obj.length === 0) return '{}'
287 return `{ ${obj
288 .map(({ key, value }) => {
289 return `${key}: ${typeof value === 'string' ? value : codegenSimpleObject(value as SimpleObject)}`
290 })
291 .join(', ')} }`
292}
293
294const VALID_JS_IDENTIFIER = /^[$_\p{ID_Start}][$\p{ID_Continue}]*$/u
295

Callers 1

generateGlueCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected