A small helper for creating typesave data models in javascript