UNPKG

ts-to-mongo-schema

Version:

Using the Typescript Compiler API, this program parses through Typescript, to generate a JSON Schema that conforms to MongoDB's bson format. Useful when generating large schemas, and being unable to use a javascript or typescript library like Moongoose.

4 lines (3 loc) 187 B
import { ts } from "ts-morph"; declare const findParentTypeAlias: (node: ts.Node) => ts.TypeAliasDeclaration | ts.InterfaceDeclaration | undefined; export default findParentTypeAlias;