Releases: kotools/types
4.5.3
✨ Added
- The
Zero.Companion.orThrow(Byte)
experimental method for Kotlin and Java platforms, and theZero.Companion.orNull(Byte)
experimental method only for Kotlin platforms (#688). - In the
EmailAddress.Companion
experimental type, theorThrow(String)
and theorThrow(String, String)
methods for Kotlin and Java platforms, theorNull(String)
and theorNull(String, String)
methods only for Kotlin platforms (#692). - The
ZeroAsByteSerializer
experimental type, in thetypes-kotlinx-serialization
subproject, for serializing theZero
type asByte
(#690). - The
EmailAddressAsStringSerializer
experimental type, in thetypes-kotlinx-serialization
subproject, for serializing theEmailAddress
type asString
(#691).
🗑️ Deprecated
- In the
Zero.Companion
experimental type, thefromByte
and thefromByteOrNull
methods with an error level for using theorThrow
and theorNull
ones instead (#688). - In the
EmailAddress.Companion
experimental type, thefromString
and thefromStringOrNull
methods with an error level for using theorThrow
and theorNull
ones instead (#692). - The
KotoolsTypesSerializers.zero
experimental property, from thetypes-kotlinx-serialization
subproject, with an error level for using theZeroAsByteSerializer
type instead (#690). - The
KotoolsTypesSerializers.emailAddress
experimental property, from thetypes-kotlinx-serialization
subproject, with an error level for using theEmailAddressAsStringSerializer
type instead (#691).
🔥 Removed
- Versions
4.0.0
and4.3.0
from the API reference (#704). - JUnit 5 and System Lambda unused dependencies (#703).
🐛 Fixed
- Inappropriate usages of the
function
word instead of themethod
one in the API reference (#706).
🔒 Security
Bumped the following NPM packages for fixing DOM Clobbering Gadget leading to XSS:
Thanks to @LVMVRQUXL for contributing to this new release. 🙏
4.5.2
✨ Added
- The following declarations to the
Zero
experimental type: - Samples to the
Zero()
constructor (7c8172d).
♻️ Changed
- The
value
parameter of thefromString
and thefromStringOrNull
functions from theEmailAddress.Companion
experimental type, that is now namedtext
(#682). - Documentation of the
EmailAddress
type, theEmailAddress.Companion.PATTERN
property, and theEmailAddress.Companion.fromString
functions (f1ac24c, 1a0ea52, fd003c4 and 4c188db). - Documentation of the
Zero
type, theZero.Companion.fromByte(Byte)
and theZero.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 thecreateOrNull
experimental functions from theNotEmptyMap.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
✨ Added
- Introduced the
Zero
experimental type representing the zero number in the neworg.kotools.types
package (#644). This package will contain reimplemented types and those from thekotools.types.*
packages will be deprecated incrementally. - Introduced the
EmailAddress
experimental type representing email addresses in theorg.kotools.types
package (#635). This new implementation provides newfromString
andfromStringOrNull
factory functions accepting avalue
argument of typeAny
. 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 apattern
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 theorg.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 thecreateOrNull
experimental functions of theNotBlankString.Companion
type now accept a value of typeAny
instead ofAny?
(#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
andExperimentalTextApi
. - The
EmailAddress
experimental type from thekotools.types.web
package is now deprecated with a warning level for using the corresponding type from theorg.kotools.types
package (#635). Itscreate
andcreateOrNull
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
✨ 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 thecreateOrNull(Any?)
experimental factory functions inNotBlankString.Companion
(#341). - The
create(Number)
andcreateOrNull(Number)
experimental factory functions in the following types: - The
create(Collection<E>)
, thecreateOrNull(Collection<E>)
and theof(E, vararg E)
experimental factory functions inNotEmptyList.Companion
(#352) and inNotEmptySet.Companion
(#353). - The
create(Map<K, V>)
, thecreateOrNull(Map<K, V>)
and theof(Pair<K, V>, vararg Pair<K, V>)
experimental factory functions inNotEmptyMap.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
andNotEmptyMap
(#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 thekotools.types.experimental
package to the newkotools.types.web
one (#377). - Make the
regex
property of theEmailAddress
experimental type inaccessible for Java sources, due to the unavailability of thekotlin.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
🐛 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
🐛 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
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) andNotEmptyRange.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
typeunaryMinus
operation onAnyInt
,NonZeroInt
,PositiveInt
,NegativeInt
,StrictlyPositiveInt
andStrictlyNegativeInt
Bound
,InclusiveBound
andExclusiveBound
types with their declarationsNotEmptyRange
type with its declarationsplus(String)
,plus(NotBlankString)
andplus(Char)
operations onNotBlankString
Char.plus(NotBlankString)
operationrange
property for companion object ofPositiveInt
,NegativeInt
,StrictlyPositiveInt
andStrictlyNegativeInt
positiveRange
andnegativeRange
properties onNonZeroInt.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
andtoNonZeroIntOrThrow
toPositiveIntOrNull
andtoPositiveIntOrThrow
toNegativeIntOrNull
andtoNegativeIntOrThrow
toStrictlyPositiveIntOrNull
andtoStrictlyPositiveIntOrThrow
toStrictlyNegativeIntOrNull
andtoStrictlyNegativeIntOrThrow
toStrictlyPositiveDoubleOrNull
andtoStrictlyPositiveDoubleOrThrow
toNotBlankStringOrNull
andtoNotBlankStringOrThrow
toNotEmptyListOrNull
andtoNotEmptyListOrThrow
toNotEmptySetOrNull
andtoNotEmptySetOrThrow
toNotEmptyMapOrNull
andtoNotEmptyMapOrThrow
.
- The
Result.flatMap
experimental function (#125). - The
Number.toStrictlyPositiveDouble
experimental function inResultContext
(5ef8aa0). - The
ExperimentalSinceKotoolsTypes
and theSinceKotoolsTypes
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
✨ Added
ExperimentalCollectionApi
annotation for marking experimental declarations of thekotools.types.collection
package (#177).- Experimental type converters suffixed by
OrNull
andOrThrow
for the following types:NonZeroInt
(#173),PositiveInt
(#155),NegativeInt
(#171),StrictlyPositiveInt
(#141),StrictlyNegativeInt
(#167),StrictlyPositiveDouble
(#132),NotBlankString
(#174),NotEmptyList
(#176),NotEmptySet
(#178) andNotEmptyMap
(#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
♻️ Changed
- Support for Kotlin 1.7.21 and kotlinx.serialization 1.4.1 (#142).
- Convert the
NotEmptyList
, theNotEmptySet
and theNotEmptyMap
types to inline value classes (#136, #137 and #138).
Thanks to @LVMVRQUXL for contributing to this new release. 🙏
4.2.0
Important
Starting from this version, this library is now published under the org.kotools
group.
This change in mind, here's an example of upgrading Kotools Types from 4.1.0 to 4.2.0 using the Kotlin DSL in Gradle:
// before
implementation("io.github.kotools:types:4.1.0")
// after
implementation("org.kotools:types:4.2.0")
✨ Added
- The
NotEmptyRange
and theBound
experimental types representing a range of comparable values that contain at least one value (#56). - The
StrictlyPositiveDouble
experimental type representing strictly positive floating-point numbers represented by theDouble
type (#66). - The
plus
experimental operations for concatenating aNotBlankString
with aString
or aChar
(#53). - The
Result.flatMap
experimental operation for transforming its encapsulated value (#47). - The
unaryMinus
experimental operations for returning the negative of anAnyInt
(#105).
♻️ Changed
- Support for Kotlin 1.6.21 and kotlinx.serialization 1.3.3 (#51).
- Library relocation from
io.github.kotools
toorg.kotools
(#63).
🗑️ Deprecated
The collections declared as data classes will be converted to classes (or inline value classes when possible) in version 4.3.0, which means that their copy
function is deprecated and will be unavailable after their conversion (#97).
Thanks to @MichaelStH and @LVMVRQUXL for contributing to this new release. 🙏