diff --git a/README.md b/README.md index 88ec75b..abf5bce 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,24 @@ pub fn main() { } ``` +## Expected values + +### Bool + +Any casing of `true`, `yes` or `1` will be parsed as `True`. Any other value will be parsed as `False`. + +### Float + +Any value that can be parsed as a float will be parsed as a float. Any other value will result in an `InvalidEnvValue` error. + +### Int + +Any value that can be parsed as an int will be parsed as an int. Any other value will result in an `InvalidEnvValue` error. + +### String + +Any value will be parsed as a string. + Further documentation can be found at . ## Development diff --git a/gleam.toml b/gleam.toml index d10c907..a6979d4 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,5 +1,5 @@ name = "glenv" -version = "0.2.0" +version = "0.2.1" licences = ["Apache-2.0"] repository = { type = "github", user = "custompro98", repo = "glenv" } description = "A library for type-safe environment variable access." diff --git a/src/glenv.gleam b/src/glenv.gleam index 7a0c258..bbc5aa1 100644 --- a/src/glenv.gleam +++ b/src/glenv.gleam @@ -7,8 +7,8 @@ import gleam/dict import gleam/dynamic import gleam/list import gleam/result +import glenv/internal/parse import gleam/string -import internal/parse /// Type represents the type of an environment variable. /// This dictates how the environment variable is parsed. diff --git a/src/internal/parse.gleam b/src/glenv/internal/parse.gleam similarity index 100% rename from src/internal/parse.gleam rename to src/glenv/internal/parse.gleam diff --git a/src/internal/parse_test.gleam b/src/glenv/internal/parse_test.gleam similarity index 98% rename from src/internal/parse_test.gleam rename to src/glenv/internal/parse_test.gleam index 5d90bd0..5eea6f7 100644 --- a/src/internal/parse_test.gleam +++ b/src/glenv/internal/parse_test.gleam @@ -1,7 +1,7 @@ import gleam/dynamic import gleeunit import gleeunit/should -import internal/parse +import glenv/internal/parse pub fn main() { gleeunit.main()