All Projects → sylvainpolletvillard → Objectmodel

sylvainpolletvillard / Objectmodel

Licence: mit
Strong Dynamically Typed Object Modeling for JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Objectmodel

pyrser
A PEG Parsing Tool
Stars: ✭ 32 (-92.29%)
Mutual labels:  typing, type-checking
Skema
🛰 Skema provides a handy & composable way to validate / transform / purify the input data.
Stars: ✭ 359 (-13.49%)
Mutual labels:  structure, model
readme-typing-svg
⚡ Dynamically generated, customizable SVG that gives the appearance of typing and deleting text. Typing SVGs can be used as a bio on your Github profile readme or repository.
Stars: ✭ 938 (+126.02%)
Mutual labels:  dynamic, typing
Supertextview
🎀 SuperTextView for Android 是一个在TextView的基础上扩展了几种动画效果的控件。
Stars: ✭ 165 (-60.24%)
Mutual labels:  typing, dynamic
Mypy Pycharm Plugin
A simple plugin that allows running mypy from PyCharm and navigate between errors
Stars: ✭ 274 (-33.98%)
Mutual labels:  type-checking, typing
Revalidate
Elegant and composable validations
Stars: ✭ 363 (-12.53%)
Mutual labels:  composition
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (-7.47%)
Mutual labels:  dynamic
Clean Code Dotnet
🛁 Clean Code concepts and tools adapted for .NET
Stars: ✭ 4,425 (+966.27%)
Mutual labels:  composition
Scriptum
A fool's scriptum on functional programming
Stars: ✭ 346 (-16.63%)
Mutual labels:  composition
Grab N Run
Grab’n Run, a simple and effective Java Library for Android projects to secure dynamic code loading.
Stars: ✭ 413 (-0.48%)
Mutual labels:  dynamic
Jsonconverter
JSONConverter is a desktop application for Mac OS X which enables you to covert JSON objects preview pretty rich JOSN and model classes
Stars: ✭ 402 (-3.13%)
Mutual labels:  model
Westore
更好的小程序项目架构
Stars: ✭ 3,897 (+839.04%)
Mutual labels:  model
Sqlalchemy Stubs
Mypy plugin and stubs for SQLAlchemy
Stars: ✭ 396 (-4.58%)
Mutual labels:  typing
Cppflow
Run TensorFlow models in C++ without installation and without Bazel
Stars: ✭ 357 (-13.98%)
Mutual labels:  model
Robust
Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Stars: ✭ 4,125 (+893.98%)
Mutual labels:  dynamic
Somepackage
Show how to structure a Python project.
Stars: ✭ 351 (-15.42%)
Mutual labels:  structure
Pydlm
A python library for Bayesian time series modeling
Stars: ✭ 375 (-9.64%)
Mutual labels:  model
Ng Dynamic Component
Dynamic components with full life-cycle support for inputs and outputs for Angular
Stars: ✭ 396 (-4.58%)
Mutual labels:  dynamic
Elasticsearch
The missing elasticsearch ORM for Laravel, Lumen and Native php applications
Stars: ✭ 375 (-9.64%)
Mutual labels:  model
Animal Matting
Github repository for the paper End-to-end Animal Image Matting
Stars: ✭ 363 (-12.53%)
Mutual labels:  composition

Strong Dynamically Typed Object Modeling for JavaScript

Downloads Version Status License


What is this library ?

ObjectModel intends to bring strong dynamic type checking to your web applications. Contrary to static type-checking solutions like TypeScript or Flow, ObjectModel can also validate data at runtime: JSON from the server, form inputs, content from localStorage, external libraries...

By leveraging ES6 Proxies, this library ensures that your variables always match the model definition and validation constraints you added to them. Thanks to the generated exceptions, it will help you spot potential bugs and save you time spent on debugging. ObjectModel is also very easy to master: no new language to learn, no new tools, no compilation step, just a minimalist and intuitive API in a plain old JS micro-library.

Validating at runtime also brings many other benefits: you can define your own types, use them in complex model definitions with custom assertions that can even change depending on your application state. Actually it goes much further than just type safety. Go on and see for yourself.

Installation

Add the library to your project dependencies with NPM:

$ npm install objectmodel

or just download the library from Github

Basic usage example

import { ObjectModel } from "objectmodel"

const Order = new ObjectModel({
	product: { name: String, quantity: Number },
	orderDate: Date
});

const myOrder = new Order({
	product: { name: "Apple Pie", quantity: 1 },
	orderDate: new Date()
});

myOrder.product.quantity = 2; // no exceptions thrown
myOrder.product.quantity = false; //try to assign a Boolean
// ❌ TypeError: expecting product.quantity to be Number, got Boolean false

Documentation

For more examples, documentation and questions, please refer to the project website: objectmodel.js.org

Changelog and Release History

Please refer to Github Releases

Bug reports and pull requests are welcome.

Distributed under the MIT license. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].