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) 171 B
import { ts } from "ts-morph"; declare function grabSubNodes(node: ts.Node | undefined, condition: (node: ts.Node) => boolean): ts.Node[]; export default grabSubNodes;