Releases: trojs/objects
Releases · trojs/objects
Add mixed field types for more flexibility
Merge pull request #88 from hckrnews/fix-optional-keys Add mixed field types for more flexibility
Finetune the validation errors
Merge pull request #87 from hckrnews/fix-optional-keys Fix optional keys
Fix optional keys
Merge pull request #86 from hckrnews/fix-optional-keys Fix optional keys
Fix the optional keys
class Test2 {
constructor(name) {
this.name = name;
}
}
const Test3Schema = {
name: String
}
const schema = {
name: String,
'test?': Test2,
'test3?': Test3Schema
}
const Test = Obj({ schema })
const test2 = new Test2('me')
const data = {
name: 'test',
test: test2,
test3: [{ name: 'test' }],
}
const test = Test.create(data)
Fix sub array validation
class Test2 {
constructor(name) {
this.name = name;
}
}
const Test3Schema = {
name: String
}
const schema = {
name: String,
test: Test2,
test3: Test3Schema
}
const Test = Obj({ schema })
const test2 = new Test2('me')
const data = {
name: 'test',
test: test2,
test3: [{ name: 'test' }],
}
const test = Test.create(data)
Test objects with custom objects
2.2.1 Merge pull request #83 from hckrnews/feature/validate-object-with-fun…
Object van now also contain and validate functions
2.2.0 Merge pull request #82 from hckrnews/feature/validate-object-with-fun…
Test with node 15
Merge pull request #71 from hckrnews/feature/node15 Test with node 15
Run build before publishing
Merge pull request #70 from hckrnews/feature/validation Run build before publishing
Minor tweaks, fix the license type in the package
Merge pull request #69 from hckrnews/feature/validation Minor tweaks, fix the license type in the package