gems dry-types 1.3.0

latest releases: 1.8.3, 1.8.2, 1.8.1...
5 years ago

Added

  • Schema#merge for merging two hash schemas (@waiting-for-dev)
  • Aliases for .constructor to non-constructor types. Now you can call .prepend/.append without silly checks for the type being a constructor (flash-gordon)
    (Dry::Types['integer'].prepend(-> { _1 + 1 })).(1) # => 2
    (Dry::Types['coercible.integer']  >> -> { _1 * 2 }).('99') # => 198
  • Hash::Schema#clear returns a schema with the same options but without keys
  • Optional namespace now includes strict types by default (@flash-gordon)

Fixed

  • Schema::Key#optional returns an instance of Schema::Key as it should have done
  • Composition with function handling exceptions. This could occasionally lead to unexpected exceptions (@flash-gordon)

Compare v1.2.2...v1.3.0

Don't miss a new dry-types release

NewReleases is sending notifications on new releases.