Changelog: v5.0.0...v5.1.0
- A prototype is preserved when an object is cloned:
class Foo {
hello = 42
}
const input = new Foo();
const output = d.object({}).strip().parse(input);
input === output
// ⮕ false
output instanceof Foo
// ❌ Before ⮕ false
// ✅ After ⮕ true
- Simple plugin imports:
import * as d from 'doubter/core';
import 'doubter/plugin/array-essentials';
d.array().nonEmpty();
readonly()
support forArrayShape
,ObjectShape
,RecordShape
,MapShape
, andSetShape
:
d.array(d.string()).readonly();
// ⮕ Shape<string[], readonly string[]>
-
Enhanced formatting of issue messages and validation error messages.
-
Multiple performance optimizations.