Skip to content

Commit

Permalink
Code review feedback on FileReader: make public vals private
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Aug 24, 2024
1 parent 4bf15e8 commit aad5b92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tyrian/src/main/scala/tyrian/cmds/FileReader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ import scala.scalajs.js.typedarray
*/
object FileReader:

val readImageCast: Result[js.Any] => Result[String] =
private val readImageCast: Result[js.Any] => Result[String] =
case Result.Error(msg) => Result.Error(msg)
case Result.NoFile(msg) => Result.NoFile(msg)
case Result.File(n, p, d) =>
try Result.File(n, p, d.asInstanceOf[String])
catch case _ => Result.Error("File is not a base64 string of image data")

val readTextCast: Result[js.Any] => Result[String] =
private val readTextCast: Result[js.Any] => Result[String] =
case Result.Error(msg) => Result.Error(msg)
case Result.NoFile(msg) => Result.NoFile(msg)
case Result.File(n, p, d) =>
try Result.File(n, p, d.asInstanceOf[String])
catch case _ => Result.Error("File is not text")

val readBytesCast: Result[js.Any] => Result[IArray[Byte]] =
private val readBytesCast: Result[js.Any] => Result[IArray[Byte]] =
case Result.Error(msg) => Result.Error(msg)
case Result.NoFile(msg) => Result.NoFile(msg)
case Result.File(n, p, d) =>
Expand Down

0 comments on commit aad5b92

Please sign in to comment.