Skip to content

Fix sub array validation

Compare
Choose a tag to compare
@w3nl w3nl released this 16 Apr 13:28
· 368 commits to master since this release
acb9a77
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)