Skip to content

Commit

Permalink
docs: clarify type casting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Florens Verschelde authored and palkan committed Aug 23, 2023
1 parent d54f2ca commit 6033b33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,14 @@ Environmental variables for your config should start with your config name, uppe

For example, if your config name is "mycoolgem", then the env var "MYCOOLGEM_PASSWORD" is used as `config.password`.

By default, environment variables are automatically type cast\*:
By default, environment variables are automatically type cast (rules are case-insensitive):

- `"True"`, `"t"` and `"yes"` to `true`;
- `"False"`, `"f"` and `"no"` to `false`;
- `"true"`, `"t"`, `"yes"` and `"y"` to `true`;
- `"false"`, `"f"`, `"no"` and `"n"` to `false`;
- `"nil"` and `"null"` to `nil` (do you really need it?);
- `"123"` to 123 and `"3.14"` to 3.14.

\* See below for coercion customization.
Type coercion can be [customized or disabled](#type-coercion).

*Anyway Config* supports nested (_hashed_) env variables—just separate keys with double-underscore.

Expand Down

0 comments on commit 6033b33

Please sign in to comment.