Javascript orm mapper
This library provides a simple way to map data from json to javascript objects that use multiple data types, including relational data types, for example: OneToMany
Installation
$ npm i javascript-orm-mapper
Tests
$ npm test
Defining Models
You can define models just like normal classes. There are no limits, you can define own methods, getters properties and whatever you want. All you have to do to make your class mappable is describing properties with type annotations
// Create database // Post // Comment
Mapping data to objects
// Result// Post {// __orm_uid: "bf9929cb-f852-43a0-9260-2e3fb89833b7",// id: "1",// name: "New name",// comments: [// Comment { // __orm_uid: "6599f446-fb0d-4194-abbd-659d40d5c9fb",// content: "Lorem ipsum",// post: Post {// __orm_uid: "bf9929cb-f852-43a0-9260-2e3fb89833b7",// id: "1",// name: "New name",// comments: [// [Circural] // ]// }// }// ]// }