skeeler
[WIP] Writing schema magically
The name is somewhat of a poor choice, but it was available on npm.
Simple Example
;;; const types = Skeeler ; const mySkeeler = foo: typesstringrequiredunique bar: typesnumberindex baz: typesobjectIdrequired qux: types; const jsonSchema = mySkeeler;const mongooseSchema = mySkeeler; ;
Equals to JSON Schema v6
const jsonSchema = properties: foo: type: 'string' bar: type: 'number' exclusiveMinimum: 0 baz: {} qux: type: 'array' items: type: 'string' required: 'foo' 'baz';
Equals to Mongoose Schema
const mongooseSchema = foo: type: String required: true unique: true bar: type: Number index: true baz: type: MongooseTypesObjectId required: true qux: type: String ;
Complex Example
;;; const types = Skeeler ; const mySkeeler = foo: typesstringrequiredunique bar: typesnumberindex baz: typesobjectIdrequired qux: types waldo: types; const jsonSchema = mySkeeler; const mongooseSchema = mySkeeler;mongooseSchemaindex foo: 'text' baz: 'text' ; ;
Related Projects
License
MIT