Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Add proper way of parsing arrays #3

Open
vnenkpet opened this issue Oct 26, 2023 · 1 comment
Open

[ENHANCEMENT] Add proper way of parsing arrays #3

vnenkpet opened this issue Oct 26, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vnenkpet
Copy link
Collaborator

vnenkpet commented Oct 26, 2023

Parse comma-separated values into arrays.

Currently it's only possible to do with stringified JSON array

LOG_LEVELS=["error","warning"]
@Env<string[]>('LOG_LEVELS', {parseJson: true)
readonly logLevels: string[]

This should work too:

LOG_LEVELS=error,warning
@Env<string[]>('LOG_LEVELS', {parseArray: true)
readonly logLevels: string[]

We should maybe also add custom delimiters:

@Env<string[]>('LOG_LEVELS', {delimiter: ';'})
readonly logLevels: string[]
@vnenkpet vnenkpet added the enhancement New feature or request label Oct 26, 2023
@otavlna otavlna self-assigned this Feb 7, 2024
@otavlna
Copy link
Collaborator

otavlna commented Feb 7, 2024

implemented in #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants