Refactor: lambda to fn

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar 2022-01-09 21:38:53 +05:30
commit 5072926bfc
2 changed files with 4 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class Config(configFilePath: String) {
(AttributesEnum.CAPTCHA_EXPIRY_TIME_LIMIT.toString -> 5) ~
(AttributesEnum.THROTTLE.toString -> 1000) ~
(AttributesEnum.THREAD_DELAY.toString -> 2) ~
(AttributesEnum.PLAYGROUND_ENABLED.toString -> "true") ~
(AttributesEnum.PLAYGROUND_ENABLED.toString -> true) ~
(AttributesEnum.CORS_HEADER.toString -> "") ~
(AttributesEnum.MAX_ATTEMPTS.toString -> 10) ~
("captchas" -> List(

View File

@ -37,5 +37,7 @@ case class ConfigField(
lazy val maxAttemptsInt: Option[Int] = mapInt(maxAttempts)
lazy val playgroundEnabledBool: Option[Boolean] = playgroundEnabled.map(_ || true)
private val mapInt = (x: Option[Integer]) => x.map(_ + 0)
private def mapInt(x: Option[Integer]): Option[Int] = {
x.map(_ + 0)
}
}