Closed riston closed 7 years ago
Not sure if the value should change after the validation is done, it should stay undefined?
const t = require("tcomb-validation"); const Point = t.struct({ x: t.maybe(t.Number), y: t.maybe(t.Number), }, "Point"); const p1 = Point({ x: 12 }); console.log(p1); // Struct { x: 12, y: undefined } -- notice y is undefined console.log(t.validate({ x: 3234 }, Point)); // Struct { errors: [], value: Struct { x: 3234, y: null } } -- notice y here has null value
In code it's strictly set to null? https://github.com/gcanti/tcomb-validation/blob/master/index.js#L132
it should stay undefined?
Yes, I think it should
Thanks for reporting, fixed in https://github.com/gcanti/tcomb-validation/releases/tag/v3.2.2
Not sure if the value should change after the validation is done, it should stay undefined?
In code it's strictly set to null? https://github.com/gcanti/tcomb-validation/blob/master/index.js#L132