prisma-markdown
Version:
Prisma Markdown documents generator including ERD diagrams and comment descriptions
26 lines • 909 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrismaUtil = void 0;
var PrismaUtil;
(function (PrismaUtil) {
PrismaUtil.tagValues = (kind) => (model) => {
var _a;
if (!((_a = model.documentation) === null || _a === void 0 ? void 0 : _a.length))
return [];
const output = [];
const splitted = model.documentation
.split("\r\n")
.join("\n")
.split("\n");
for (const line of splitted) {
const first = line.indexOf(`@${kind} `);
if (first === -1)
continue;
output.push(line.slice(first + kind.length + 2).trim());
}
return output
.map((str) => str.trim())
.filter((str) => !!str.length);
};
})(PrismaUtil || (exports.PrismaUtil = PrismaUtil = {}));
//# sourceMappingURL=PrismaUtil.js.map