Extending / adding ottoman types


#1

Would Ottoman be open to receiving a pull request that would add a new basic data type?

Right now, Ottoman is limited to certain CoreTypes, things like Date, string, number, integer, Mixed. It would be extremely helpful to have an arbitrary precision data types for very precise numbers. Floating point precision issues in node are well understood, so the basic “number” type unfortunately doesn’t do it for some use cases.

Looking in the Ottoman source, it seems as though I’d need to add a new CoreType in schema.js, then rig to toCoo() method in ModelInstance to appropriately serialize the value, and fromCoo() to deserialize. Anything else that would be necessary? And if I did this, would anyone else want it?


#2

Hey @moxious,

We are definitely open to pull requests from the community! Feel free to create a change on GitHub and we can discuss and likely merge it there!

Cheers, Brett