faker
faker copied to clipboard
refactor(address.nearbyGPSCoordinate)!: return type to number tuple
Discussion reference #1058.
Changes the return type of address.nearbyGPSCoordinate() from a string tuple to a number tuple.
This is a breaking change and should not be merged before the next major release.
Codecov Report
Merging #1061 (2513123) into next (2c9622b) will decrease coverage by
0.00%. The diff coverage is100.00%.
:exclamation: Current head 2513123 differs from pull request most recent head 5ab3c8b. Consider uploading reports for the commit 5ab3c8b to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## next #1061 +/- ##
==========================================
- Coverage 99.61% 99.60% -0.01%
==========================================
Files 2166 2164 -2
Lines 237450 236816 -634
Branches 1040 999 -41
==========================================
- Hits 236543 235888 -655
- Misses 886 906 +20
- Partials 21 22 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/modules/commerce/index.ts | 100.00% <ø> (ø) |
|
| src/modules/helpers/index.ts | 98.44% <ø> (-0.07%) |
:arrow_down: |
| src/modules/image/providers/lorempicsum.ts | 93.85% <ø> (-1.00%) |
:arrow_down: |
| src/modules/image/providers/lorempixel.ts | 91.30% <ø> (-0.65%) |
:arrow_down: |
| src/modules/image/providers/unsplash.ts | 100.00% <ø> (+4.67%) |
:arrow_up: |
| src/modules/phone/index.ts | 100.00% <ø> (ø) |
|
| src/faker.ts | 100.00% <100.00%> (ø) |
|
| src/index.ts | 100.00% <100.00%> (ø) |
|
| src/modules/address/index.ts | 99.78% <100.00%> (-0.05%) |
:arrow_down: |
| src/modules/company/index.ts | 100.00% <100.00%> (ø) |
|
| ... and 6 more |
The description text should include a hint that the user might want to use toFixed on the result and some reference how much another digit is in precision. E.g. 1 degree = 100 km. 1km = 0.01degree/ToFixed(2). We dont have to use precises values but some rough estimates. I guessed these values so you should probably verify them first.
Don't know about this. That wasn't the case before either. IMO, this is on the user side, since our responsibility is the (fake) data generation not being a wiki on how specific data should be handled. If someone requests GPS coordinates I would expect them to know how to work with them.
Considering the other PR, should we rather introduce a format parameter?
Considering the other PR, should we rather introduce a
formatparameter?
It doesn't make sense to me that coordinates should be strings. We simply allow the input of stringified numbers due to the nature of JS. At least that's what I like to think.
Cross referencing related PRs:
- https://github.com/faker-js/faker/pull/1066
- https://github.com/faker-js/faker/pull/1064
- https://github.com/faker-js/faker/pull/1061
It doesn't make sense to me that coordinates should be strings. We simply allow the input of stringified numbers due to the nature of JS. At least that's what I like to think.
Further discussion regarding that topic please in https://github.com/faker-js/faker/pull/1066 or a separate issue/discussion.
I eagerly put the PR title to scope location as we will solve
- #1344
in v8.0 and this will then be grouped together