UNPKG

prisma-json-types-generator

Version:
18 lines 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractPrismaModels = void 0; const regex_1 = require("./regex"); /** * Parses the DMMF document and returns a list of models that have at least one field with * typed json and the regexes for each field type. */ function extractPrismaModels(dmmf) { return (dmmf.datamodel.models // Define the regexes for each model .map((model) => ({ ...model, regexps: (0, regex_1.createRegexForType)(model.name) }))); } exports.extractPrismaModels = extractPrismaModels; //# sourceMappingURL=dmmf.js.map