import { ClientEngineType } from '@prisma/sdk' ; import lzString from 'lz-string' ; param engineType param dmmf returns export function buildDMMF ( engineType , dmmf ) { if ( engineType === ClientEngineType . DataProxy ) { return buildCompressedDMMF ( dmmf ) ; } return buildUncompressedDMMF ( dmmf ) ; } param dmmf returns function buildCompressedDMMF ( dmmf ) { const compressedDMMF = lzString . compressToBase64 ( dmmf ) ; return `
const compressedDMMF = '${ compressedDMMF }'
const decompressedDMMF = decompressFromBase64(compressedDMMF)
// We are parsing 2 times, as we want independent objects, because
// DMMFClass introduces circular references in the dmmf object
const dmmf = JSON.parse(decompressedDMMF)
exports.Prisma.dmmf = JSON.parse(decompressedDMMF)` ; } param dmmf returns function buildUncompressedDMMF ( dmmf ) { return `
const dmmfString = ${ JSON . stringify ( dmmf ) }
const dmmf = JSON.parse(dmmfString)
exports.Prisma.dmmf = JSON.parse(dmmfString)` ; }