Skip to content

Patch version 1.0.1

Choose a tag to compare

@AgustinSRG AgustinSRG released this 24 Oct 11:59
· 1 commit to master since this release
ee959cb

Fix minor issue related to optional properties not allowing null.

Example:

const schema = ObjectSchema.create()
            .withProperty("req", ObjectSchema.string().withDefaultValue(""))
            .withProperty("opt", ObjectSchema.optional(ObjectSchema.string().withDefaultValue("")));

expect(schema.test({ req: "Example Required", opt: "Example Optional" })).to.be.true;
expect(schema.test({ req: "Example Required" })).to.be.true;
expect(schema.test({ req: "Example Required", opt: null})).to.be.true; // Before the fix, this was false