-
-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Description
faker helper behavior is to stringify arrays and objects.
Considering the recent improvements to helpers in general (avoiding stringifying to maximize compatibility between helpers) this should be changed.
Multiple possibilities:
- add a new helper
fakerRawnot stringifying the results. - add a new param (named) if possible.
- remove the stringify. This would cause a breaking change which impact should be assessed.
Discussed in #879
Originally posted by sureMOISE December 6, 2022
is it possibile to get the value from a variable array?
example:
{{setVar 'refLat' (faker 'address.latitude' 46.722873 46.713458 8)}}
{{setVar 'refLong' (faker 'address.longitude' 8.121358 8.102806 8)}}
{{setVar 'coords' (faker 'address.nearbyGPSCoordinate' (array (parseInt @refLat) ( parseInt @refLong)) 1 true)}}the variable @coords return ['46.722873', '8.102806'] and I need to retrive the first and the second value in an object, in something like:
{
"latitude": {{{@coords[0]}}},
"longitude": {{{@coords[1]}}}
}the final result should be:
{
"latitude": 46.722873,
"longitude": 8.102806
}any idea? thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done (ready for next release)