Proposal: Replace internal fake patterns with a resolver function #3176
Labels
c: feature
Request for new feature
m: helpers
Something is referring to the helpers module
p: 1-normal
Nothing urgent
Milestone
Continuation of/Requires: #2667, #2838
Partially inspired by: #1832, #2664
Clear and concise description of the problem
Glossary:
fakerCore
as an argument and return a value based on a seedCurrently, some faker internal methods use fake patterns to generate some complex values based on certain parameters.
However parsing fake patterns is slow and error prone.
Suggested solution
Introduce a new helper method:
faker.helpers.resolve(fns: ResolverFunction[])
This could later be extended to support parameters as well.
Fake-Usage (OLD)
Resolve-Usage (NEW)
Pros
Cons
Affected Methods
And potentially:
Alternatives
Alternatively, we could follow this pattern for each method individually.
The text was updated successfully, but these errors were encountered: