Skip to content

Releases: AlexGalays/idonttrustlikethat

2.1.2

03 Jan 20:18
Compare
Choose a tag to compare

Add new validators:

  • readonlyArray
  • arrayAsSet

2.1.0

17 Jun 10:33
Compare
Choose a tag to compare

(Tiny) Breaking change: Fix the path of nested dictionary value errors: they would stop at the dictionary level instead of reporting the complete path.

2.0.6

23 Jul 14:05
Compare
Choose a tag to compare
  • Improvement: When using nonEmpty with an Array as input, the returned type will be NonEmptyArray, allowing you to safely access the first element even with the noUncheckedIndexedAccess compiler arg.

2.0.5

20 Jul 18:33
Compare
Choose a tag to compare

improvement:

  • discriminatedUnion now can point not only to a literal validator but also to a union of literals.

Fix:

  • The last withError would always win, it now propagates properly (you can have as many withError chained with other transformations.

2.0.4

19 Jul 14:24
Compare
Choose a tag to compare

Fix: discriminatedUnion now accepts intersections of Objects.

2.0.3

01 Jul 14:11
Compare
Choose a tag to compare
  • default() now implicitly call nullable() before it.

2.0.2

21 Apr 09:23
Compare
Choose a tag to compare

Fix type inference issue with nonEmpty

2.0.1

19 Apr 11:52
Compare
Choose a tag to compare

Move all the extra validators back into the main module.

2.0.0

15 Apr 14:29
Compare
Choose a tag to compare
  • Introduce a new module: idonttrustlikethat/extra which will contain various non critical validators that I found are still useful in many cases.

The rationale for a new extra module is that many people are doing import * as v from 'idonttrustlikethat' but I hope they do import {isoDate} from 'idonttrustlikethat/extra' and can beneficiate from tree shaking. There's not much to tree shake in the main module as it contain all the JSON validators and utilities around those. Also, extra is a nice showcase of how easy it is to create new validators from the basic building blocks.

Added new extra validators:

  • url
  • absoluteUrl
  • relativeUrl
  • minSize
  • nonEmpty
  • booleanFromString
  • numberFromString
  • intFromString

Breaking changes:

  • flatMap is renamed to and.
  • isoDate, recursion and snakeCaseTransformation are moved to extra.
  • withError() now takes a function with the first argument being the value that we tried to validate.