Skip to content

Commit

Permalink
Added nullableDouble and nullableFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Dec 30, 2023
1 parent f606433 commit 612f4c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tribune-core/src/main/kotlin/com/sksamuel/tribune/core/Parsers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ object Parsers {
*/
val nullableLong: Parser<Long?, Long?, Nothing> = Parser()

/**
* An identity [Parser] for nullable doubles.
*/
val nullableDouble : Parser<Double?, Double?, Nothing> = Parser()

/**
* An identity [Parser] for nullable floats.
*/
val nullableFloat : Parser<Double?, Double?, Nothing> = Parser()

/**
* A [Parser] for nullable types, which returns the input if not null, or an error if null.
* The error is derived from the given [errorFn] function.
Expand Down

0 comments on commit 612f4c2

Please sign in to comment.