Skip to content

Releases: kotools/types

5.0.0

13 Jan 16:51
5.0.0
1d83d38
Compare
Choose a tag to compare

✨ Added

  • Support iOS Simulator arm64 and iOS x64 Kotlin Native targets (#415 and #416).
  • Dependency upgrades strategy in the dependency compatibility documentation (#289).
  • Overloads for the orNull and the orThrow functions in the Zero.Companion experimental type, for creating an instance of Zero from a number of type Short (#716), Int (#717), Long (#718), Float (#719) and Double (#720), or from a text of type String (#761).

♻️ Changed

  • Bump embedded Kotlin from 1.8.22 to 1.9.25, Kotlin language version from 1.5 to 1.9, and kotlinx.serialization from 1.5.1 to 1.6.3 (#407 and #740).
  • Use default package names for Linux x64, macOS x64 and MinGW x64 Kotlin Native targets (#405).
  • Move ExperimentalKotoolsTypesApi from the kotools.types.experimental package to the org.kotools.types one (#636).
  • Documentation of EmailAddress.Companion.PATTERN that now refers to RegExr (#762).

🔥 Removed

  • KotoolsTypesSerializers.zero deprecated property from the experimental API (#723).
  • KotoolsTypesSerializers.emailAddress deprecated property, from the experimental API (#727).
  • Hidden annotations from the kotools.types.experimental package (#318).
  • Zero.Companion.fromByte and Zero.Companion.fromByteOrNull deprecated functions from the experimental API (#715).
  • EmailAddress.Companion.fromString and EmailAddress.Companion.fromStringOrNull deprecated functions from the experimental API (#721).

🐛 Fixed

  • Links to the API reference from the README documentation (#742).

Thanks to @bodiam and @LVMVRQUXL for contributing to this new release. 🙏

4.5.3

20 Oct 11:09
4.5.3
71f53d2
Compare
Choose a tag to compare

✨ Added

  • The Zero.Companion.orThrow(Byte) experimental method for Kotlin and Java platforms, and the Zero.Companion.orNull(Byte) experimental method only for Kotlin platforms (#688).
  • In the EmailAddress.Companion experimental type, the orThrow(String) and the orThrow(String, String) methods for Kotlin and Java platforms, the orNull(String) and the orNull(String, String) methods only for Kotlin platforms (#692).
  • The ZeroAsByteSerializer experimental type, in the types-kotlinx-serialization subproject, for serializing the Zero type as Byte (#690).
  • The EmailAddressAsStringSerializer experimental type, in the types-kotlinx-serialization subproject, for serializing the EmailAddress type as String (#691).

🗑️ Deprecated

  • In the Zero.Companion experimental type, the fromByte and the fromByteOrNull methods with an error level for using the orThrow and the orNull ones instead (#688).
  • In the EmailAddress.Companion experimental type, the fromString and the fromStringOrNull methods with an error level for using the orThrow and the orNull ones instead (#692).
  • The KotoolsTypesSerializers.zero experimental property, from the types-kotlinx-serialization subproject, with an error level for using the ZeroAsByteSerializer type instead (#690).
  • The KotoolsTypesSerializers.emailAddress experimental property, from the types-kotlinx-serialization subproject, with an error level for using the EmailAddressAsStringSerializer type instead (#691).

🔥 Removed

🐛 Fixed

  • Inappropriate usages of the function word instead of the method one in the API reference (#706).

🔒 Security

Bumped the following NPM packages for fixing DOM Clobbering Gadget leading to XSS:

  • rollup from version 2.68.0 to 2.79.2 (#730).
  • webpack from version 5.76.3 to 5.94.0 (#728).

Thanks to @LVMVRQUXL for contributing to this new release. 🙏

4.5.2

24 Jul 19:07
4.5.2
b0d597d
Compare
Choose a tag to compare

✨ Added

  • The following declarations to the Zero experimental type:
    • compareTo(Byte), compareTo(Short), compareTo(Int), compareTo(Long), compareTo(Float) and compareTo(Double) functions (#650)
    • toByte(), toShort(), toInt(), toLong(), toFloat(), toDouble() and toChar() functions (#646).
  • Samples to the Zero() constructor (7c8172d).

♻️ Changed

  • The value parameter of the fromString and the fromStringOrNull functions from the EmailAddress.Companion experimental type, that is now named text (#682).
  • Documentation of the EmailAddress type, the EmailAddress.Companion.PATTERN property, and the EmailAddress.Companion.fromString functions (f1ac24c, 1a0ea52, fd003c4 and 4c188db).
  • Documentation of the Zero type, the Zero.Companion.fromByte(Byte) and the Zero.Companion.fromByteOrNull(Byte) functions (#681 and ccaaa3a).
  • Samples for using assertions instead of printing values and collapsing them by default (#641 and #678).
  • Kotlin and Java samples of the StrictlyNegativeDouble.Companion.create(Number) function (0a4258f).

🐛 Fixed

  • API dependencies of the types-kotlinx-serialization subproject by exporting the kotlinx.serialization library (#700).
  • Kotlin samples of the create and the createOrNull experimental functions from the NotEmptyMap.Companion type (1fa89b0 and 35d599b).
  • Java sample of the StrictlyNegativeDouble.equals(Any?) experimental function (c862e0c).

🔥 Removed

  • The kotools.types.web.EmailAddress deprecated type from the experimental API (#663).
  • Availability of the Zero.Companion.fromByteOrNull(Byte) experimental function from Java code (#683).
  • Availability of the EmailAddress.Companion.fromStringOrNull experimental functions from Java code (#684).

Thanks to @LVMVRQUXL and @MartiPresa for contributing to this new release. 🙏

4.5.1

28 Apr 14:58
4.5.1
5df10f4
Compare
Choose a tag to compare

✨ Added

  • Introduced the Zero experimental type representing the zero number in the new org.kotools.types package (#644). This package will contain reimplemented types and those from the kotools.types.* packages will be deprecated incrementally.
  • Introduced the EmailAddress experimental type representing email addresses in the org.kotools.types package (#635). This new implementation provides new fromString and fromStringOrNull factory functions accepting a value argument of type Any. For simplicity purpose, the default pattern used for validating email addresses is ^\S+@\S+\.\S+$, which allows a wider range of values. But it is also possible to provide a pattern argument to these new factory functions for customizing the validation.
val value: Any = "[email protected]"
val pattern: Any = "^[a-z]+@[a-z]+\\.[a-z]+\$"
val emailAddress: EmailAddress = EmailAddress.fromString(value, pattern)
println(emailAddress) // "[email protected]"
  • New types-kotlinx-serialization module for supporting serialization of types from the org.kotools.types package using the Kotlin Serialization library (#602). See its README documentation for more details on how to use it.

♻️ Changed

  • Our versioning strategy is now based on backward compatibility, focusing on behavioral, source and binary compatibilities.
  • The create and the createOrNull experimental functions of the NotBlankString.Companion type now accept a value of type Any instead of Any? (#626).
// Before
NotBlankString.create(null) // pass
NotBlankString.createOrNull(null) // pass

// Now
NotBlankString.create(null) // compilation error
NotBlankString.createOrNull(null) // compilation error
  • The documentation of the AnyInt(Int) experimental constructor-like function now uses collapsing sections for splitting Kotlin and Java samples (8eb8044).

🗑️ Deprecated

  • The following annotations are now hidden from sources (#334): ExperimentalCollectionApi, ExperimentalNumberApi, ExperimentalRangeApi, ExperimentalResultApi and ExperimentalTextApi.
  • The EmailAddress experimental type from the kotools.types.web package is now deprecated with a warning level for using the corresponding type from the org.kotools.types package (#635). Its create and createOrNull factory functions are also deprecated with an error level for this reason.

🔥 Removed

Due to an internal compilation error of Kotlin when comparing generics, the following types have been removed from the experimental API: NotEmptyRange, Bound, InclusiveBound and ExclusiveBound (#627). Experimental properties using these types were also removed.


Thanks to @augustomtt and @LVMVRQUXL for contributing to this new release. 🙏

4.5.0

14 Mar 10:30
4.5.0
f929061
Compare
Choose a tag to compare

✨ Added

  • Support macOS arm64 systems with Kotlin Native (#414).
  • The StrictlyNegativeDouble experimental type for representing a floating-point number of type Double that is less than zero (#555).
  • The create(Any?) and the createOrNull(Any?) experimental factory functions in NotBlankString.Companion (#341).
  • The create(Number) and createOrNull(Number) experimental factory functions in the following types:
    • StrictlyPositiveInt.Companion (#342)
    • StrictlyNegativeInt.Companion (#347)
    • PositiveInt.Companion (#349)
    • NegativeInt.Companion (#350)
    • NonZeroInt.Companion (#351).
  • The create(Collection<E>), the createOrNull(Collection<E>) and the of(E, vararg E) experimental factory functions in NotEmptyList.Companion (#352) and in NotEmptySet.Companion (#353).
  • The create(Map<K, V>), the createOrNull(Map<K, V>) and the of(Pair<K, V>, vararg Pair<K, V>) experimental factory functions in NotEmptyMap.Companion (#354).
  • The NotBlankString.plus(Any) experimental operation (#543).
  • Documentation of dependency compatibility (#288).
  • The documentation of the serialization and the deserialization processes in the API reference for the following types: AnyInt, NonZeroInt, PositiveInt, NegativeInt, StrictlyPositiveInt, StrictlyNegativeInt, ZeroInt, NotBlankString, NotEmptyList, NotEmptySet and NotEmptyMap (#256).
  • References to the corresponding factory functions for eligible types in the API reference (cfc99b2).
  • Tagline suggested by @jmfayard in the README documentation (#338).

♻️ Changed

  • Bump embedded Kotlin from 1.7.21 to 1.8.22 (#172 and #196).
  • Bump kotlinx.serialization from 1.4.0 to 1.5.1 (#378 and #381).
  • Move the EmailAddress experimental type from the kotools.types.experimental package to the new kotools.types.web one (#377).
  • Make the regex property of the EmailAddress experimental type inaccessible for Java sources, due to the unavailability of the kotlin.text.Regex type for this language (8d0d098).
  • Update the regular expression of the EmailAddress experimental type for following the RFC-5322 (#394).
  • Update our Git commit messages convention using Gitmoji in our Contribution Guidelines (#490).

🗑️ Deprecated

Deprecation promotion of the following annotations to error (#333):

  • ExperimentalCollectionApi
  • ExperimentalNumberApi
  • ExperimentalRangeApi
  • ExperimentalResultApi
  • ExperimentalTextApi

🔥 Removed

The plus experimental operations using the NotBlankString type (#542).


Thanks to @jmfayard and @LVMVRQUXL for contributing to this new release. 🙏

4.4.2

07 Feb 18:06
4.4.2
a820079
Compare
Choose a tag to compare

🐛 Fixed

Serialization problems using the Kotlin/JS IR compiler for all serializable types (#431).


Thanks to @robertfmurdock and @LVMVRQUXL for contributing to this new release. 🙏

4.4.1

02 Feb 04:12
4.4.1
90388ad
Compare
Choose a tag to compare

🐛 Fixed

The types-internal subproject was missing in the Gradle dependency tree of Kotools Types 4.4.0 (#406).


Thanks to @robertfmurdock and @LVMVRQUXL for contributing to this new release. 🙏

4.4.0

29 Jan 09:37
4.4.0
ac3a46d
Compare
Choose a tag to compare

Important

Due to a packaging error in this version, reported by @robertfmurdock in issue #406, users should upgrade directly to version 4.4.1.

✨ Added

  • EmailAddress experimental type, suggested by @MichaelStH in #55, for representing an email address (#339).
  • AnyInt(Int) experimental factory function (571428b).
  • Companion object for the following experimental types: InclusiveBound (a8aedb4), ExclusiveBound (76ba063), NotEmptyRange (a4399cc) and NotEmptyRange.BuilderScope (79e093c).
  • ExperimentalKotoolsTypesApi annotation for marking experimental declarations (#191).
  • Security policy indicating which versions are supported with security updates and how to report a security vulnerability (#250).
  • Documentation of versioning strategy and declarations lifecycle (#215 and #307).
  • Versions 4.1.0, 4.0.1, 4.0.0, 3.2.0, 2.0.0 and 1.3.1 in API reference (#261).

♻️ Changed

  • Move the following experimental declarations to the kotools.types.experimental package with a new signature (#319):
    • StrictlyPositiveDouble type
    • unaryMinus operation on AnyInt, NonZeroInt, PositiveInt, NegativeInt, StrictlyPositiveInt and StrictlyNegativeInt
    • Bound, InclusiveBound and ExclusiveBound types with their declarations
    • NotEmptyRange type with its declarations
    • plus(String), plus(NotBlankString) and plus(Char) operations on NotBlankString
    • Char.plus(NotBlankString) operation
    • range property for companion object of PositiveInt, NegativeInt, StrictlyPositiveInt and StrictlyNegativeInt
    • positiveRange and negativeRange properties on NonZeroInt.Companion.
  • Opt-in message of experimental annotations (#328).
  • Documentation of types in API reference and in README (ed9322d).
  • Align styles of version 4.2.0 with the latest ones in API reference (#261).

🗑️ Deprecated

ExperimentalCollectionApi, ExperimentalNumberApi, ExperimentalRangeApi, ExperimentalResultApi and ExperimentalTextApi annotations (#327).

🔥 Removed

  • The following experimental factory functions (#258):
    • toNonZeroIntOrNull and toNonZeroIntOrThrow
    • toPositiveIntOrNull and toPositiveIntOrThrow
    • toNegativeIntOrNull and toNegativeIntOrThrow
    • toStrictlyPositiveIntOrNull and toStrictlyPositiveIntOrThrow
    • toStrictlyNegativeIntOrNull and toStrictlyNegativeIntOrThrow
    • toStrictlyPositiveDoubleOrNull and toStrictlyPositiveDoubleOrThrow
    • toNotBlankStringOrNull and toNotBlankStringOrThrow
    • toNotEmptyListOrNull and toNotEmptyListOrThrow
    • toNotEmptySetOrNull and toNotEmptySetOrThrow
    • toNotEmptyMapOrNull and toNotEmptyMapOrThrow.
  • The Result.flatMap experimental function (#125).
  • The Number.toStrictlyPositiveDouble experimental function in ResultContext (5ef8aa0).
  • The ExperimentalSinceKotoolsTypes and the SinceKotoolsTypes internal annotations (9052e77 and 557350b).

🐛 Fixed

The copyright notice in the license (#257).

🔒 Security

  • Hide all internals from Java users (#303).
  • Upgrade to Webpack 5.76.3 for avoiding cross-realm object access on Kotlin/JS (#313).

Thanks to @MichaelStH and @LVMVRQUXL for contributing to this new release. 🙏

4.3.1

25 Sep 20:41
4.3.1
1025243
Compare
Choose a tag to compare

✨ Added

  • ExperimentalCollectionApi annotation for marking experimental declarations of the kotools.types.collection package (#177).
  • Experimental type converters suffixed by OrNull and OrThrow for the following types: NonZeroInt (#173), PositiveInt (#155), NegativeInt (#171), StrictlyPositiveInt (#141), StrictlyNegativeInt (#167), StrictlyPositiveDouble (#132), NotBlankString (#174), NotEmptyList (#176), NotEmptySet (#178) and NotEmptyMap (#179).

♻️ Changed

  • Source compatibility with Kotlin improved by supporting its versions 1.5 through 1.7 (#213).
  • Support multiple versions in the API reference starting from version 4.2.0 (#198 and #205).

🐛 Fixed

Typo in the documentation of the notEmptyRangeOf function (#222).


Thanks to @o-korpi and @LVMVRQUXL for contributing to this new release. 🙏

4.3.0

14 Aug 16:08
4.3.0
e131471
Compare
Choose a tag to compare

♻️ Changed


Thanks to @LVMVRQUXL for contributing to this new release. 🙏