-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
faker.system.directoryPath should have a "depth" option #3785
Copy link
Copy link
Open
Labels
c: featureRequest for new featureRequest for new featurehas workaroundWorkaround provided or linkedWorkaround provided or linkedm: systemSomething is referring to the system moduleSomething is referring to the system modules: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature
Milestone
Metadata
Metadata
Assignees
Labels
c: featureRequest for new featureRequest for new featurehas workaroundWorkaround provided or linkedWorkaround provided or linkedm: systemSomething is referring to the system moduleSomething is referring to the system modules: waiting for user interestWaiting for more users interested in this featureWaiting for more users interested in this feature
Fields
Give feedbackNo fields configured for issues without a type.
Clear and concise description of the problem
When generating a path using
faker.system.directoryPaththere should be an option to specify how "deep" of a. path should be generated.Suggested solution
Add parameters to the function that allows the user to specify how deep of a directory path they want generated.
Depth examples:
//etc, or/usr/etc/mailor/usr/lib/usr/lib/logDepth value could be passed either as a parameter, or as part of an "options" object
If no depth parameter is included, function would behave as it does today.
Alternative
No response
Additional context
This functionality would be extremely useful when generating test data for parent/child path structures. For example, if I'm generating something with a path of
/x/y/z, and the structure includes a "parent" property, it would be easier to generate a value that could be used to set both if the depth of the directory structure could be set.