Skip to content

v5.1.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 25 Oct 14:14

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 for ArrayShape, ObjectShape, RecordShape, MapShape, and SetShape:
d.array(d.string()).readonly();
// ⮕ Shape<string[], readonly string[]>
  • Enhanced formatting of issue messages and validation error messages.

  • Multiple performance optimizations.