UNPKG

prisma-json-types-generator

Version:
21 lines 972 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findPrismaClientGenerators = findPrismaClientGenerators; const error_1 = require("./error"); /** * Finds the `prisma-client-generator` configuration from a list of generators or throws * an error. */ function findPrismaClientGenerators(generators) { const options = generators.filter((g) => g.provider.value === 'prisma-client-js' || g.provider.value === 'prisma-client'); if (!options.length) { throw new error_1.PrismaJsonTypesGeneratorError('Could not find client generator options, are you using `prisma-client-js` or `prisma-client` before `prisma-json-types-generator`?'); } for (const option of options) { if (!option.output?.value) { throw new error_1.PrismaJsonTypesGeneratorError('`prisma-client-js` or `prisma-client` output not found', options); } } return options; } //# sourceMappingURL=prisma-generator.js.map