MCPcopy
hub / github.com/prisma/prisma / addPreambleToJSFiles

Function addPreambleToJSFiles

packages/client-generator-js/src/utils/addPreamble.ts:12–20  ·  view source on GitHub ↗
(fileMap: FileMap)

Source from the content-addressed store, hash-verified

10 * To ensure it is clear that this is generated code and shall not be lint checked.
11 */
12export function addPreambleToJSFiles(fileMap: FileMap) {
13 for (const [key, value] of Object.entries(fileMap)) {
14 if (typeof value === 'string' && (key.endsWith('.js') || key.endsWith('.mjs'))) {
15 fileMap[key] = addPreamble(value)
16 } else if (typeof value === 'object' && value !== null) {
17 addPreambleToJSFiles(value)
18 }
19 }
20}
21
22export function addPreamble(fileContent: string) {
23 return generatedCodePreamble + fileContent

Callers 1

buildClientFunction · 0.90

Calls 2

addPreambleFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected