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.

11 lines (10 loc) 241 B
import { ts } from "ts-morph"; declare function categorizeNodes(nodes: ts.Node[]): { imports: { [key: string]: string; }; identifiers: { [key: string]: ts.Node; }; }; export default categorizeNodes;