objecture
Version:
❂ Objecture ⏣ Object Watcher, Property Manager ⊚ Capture property changes for object, array mutator methods. ⊚ Schematize and validate object, array properties. ⊚ Browser, NodeJS compatible. ⁘ Uses Core-Plex - Event Listener Manage
63 lines (61 loc) • 980 B
Markdown
| [❂ Objecture](../../../../README.md) | [Guide](../../index.md) | [Schema](../index.md) | *Validators* |
| :-- | :-- | :-- | :-- |
# ⏣ Objecture Guide \| Schema
## Objecture Schema Validators
### Schema Type Validator
```
const object = new Model({
propertyA: true,
propertyB: 1,
propertyC: "TRUE",
}, {
propertyA: Boolean,
propertyB: Number,
propertyC: String,
})
console.log(object.valueOf())
```
***logs***
```
{
propertyA: true,
propertyB: 1,
propertyC: "TRUE",
}
```
***then***
```
const object = new Model({
propertyA: "TRUE",
propertyB: true,
propertyC: 1,
}, {
propertyA: Boolean,
propertyB: Number,
propertyC: String,
})
console.log(object.valueOf())
```
***logs***
```
{
propertyB: true,
}
```
***then***
```
const object = new Model({
propertyA: "TRUE",
propertyB: "true",
propertyC: 1,
}, {
propertyA: Boolean,
propertyB: Number,
propertyC: String,
})
console.log(object.valueOf())
```
***logs***
```
{}
```