gcanti / io-ts-types

A collection of codecs and combinators for use with io-ts
https://gcanti.github.io/io-ts-types/
MIT License
311 stars 40 forks source link

Fix DateFromUnixTime.encode returning a floating point number #160

Closed saevarb closed 3 years ago

saevarb commented 3 years ago

This solves #159 and I also figured out why the tests didn't catch this and updated them. The date used for testing did not include any hours/mins/secs/etc so this slipped through.

All tests pass except for some type-level tests which I can only assume must have failed previously?


Running type-level tests for the following versions: ["3.5","3.6","3.7","3.8","3.9","4.0","4.1","4.2"]
Error: /home/sbrg/mess/io-ts-types/dtslint/ts3.5/readonlyNonEmptyArray.ts:6:1
ERROR: 6:1  expect  Expected type to be:
  (i: unknown) => Either<Errors, ReadonlyNonEmptyArray<string>>
got:
  (i: unknown) => Validation<ReadonlyNonEmptyArray<string>>

/home/sbrg/mess/io-ts-types/dtslint/ts3.5/readonlySetFromArray.ts:7:1
ERROR: 7:1  expect  Expected type to be:
  (i: unknown) => Either<Errors, ReadonlySet<string>>
got:
  (i: unknown) => Validation<ReadonlySet<string>>
gcanti commented 3 years ago

All tests pass except for some type-level tests which I can only assume must have failed previously?

Looks something related to typescript@4.2, don't worry about that, I'll fix it later, thanks.