You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the value of the deterministic generator is nailed down in FakerSettings. It is used in the function generateWithSettings.
I propose that this function checks if:
A certain environment variable is set.
It parses to a number.
The value of the generator in the given settings is default.
The mode of generation is deterministic.
— And if all are true, the value of the parsed environment variable is used as the generator instead of the default value.
The goal is to make it possible to adjust the generator in a convenient way. Of course there are already ways to adjust the generator, but they all require passing it around the code one way or another, which is rather inconvenient.
This change is conservative and backwards compatible. I can write the code and make a pull request.
The text was updated successfully, but these errors were encountered:
This is a valid concern. I have not measured the cost of access to environment variables — I imagine it to be small but who knows. On the other hand, introducing this new function will result in some code duplication — I cannot see a way to express any one of generateWithSettings and generateWithEnvSettings in terms of the other. Whichever works for you is fine by me!
On the other hand, introducing this new function will result in some code duplication — I cannot see a way to express any one of generateWithSettings and generateWithEnvSettings in terms of the other.
Currently, the value of the deterministic generator is nailed down in
FakerSettings
. It is used in the functiongenerateWithSettings
.I propose that this function checks if:
— And if all are true, the value of the parsed environment variable is used as the generator instead of the default value.
The goal is to make it possible to adjust the generator in a convenient way. Of course there are already ways to adjust the generator, but they all require passing it around the code one way or another, which is rather inconvenient.
This change is conservative and backwards compatible. I can write the code and make a pull request.
The text was updated successfully, but these errors were encountered: