Skip to content

Commit 2a2a132

Browse files
authored
docs: merge migration guide snippet (#2935)
1 parent c1aca55 commit 2a2a132

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

docs/guide/upgrading.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,20 @@ Removed deprecated location methods
424424
| `faker.location.ordinalDirection(abbreviated)` | `faker.location.ordinalDirection({ abbreviated })` |
425425
| `faker.location.nearbyGPSCoordinate(coordinate, radius, isMetric)` | `faker.location.nearbyGPSCoordinate({ origin, radius, isMetric })` |
426426

427-
#### Removed Definitions
427+
#### Direction definitions reorganized
428+
429+
The locale definitions used by `faker.location.direction()`, `faker.location.cardinalDirection()` and `faker.location.ordinalDirection()` have been reorganized.
430+
Previously, they were located under `definitions.location.direction` and `definitions.location.direction_abbr` and their values were required to be in a specific order.
431+
Now, all values are nested under `definitions.location.direction` with descriptive property names.
432+
If you are using the public methods, no changes are required.
433+
You only need to change your code if you are accessing the raw definitions e.g. in `faker.helpers.fake()`.
434+
435+
| Before | After |
436+
| ------------------------- | ----------------------------------------------------------------------- |
437+
| `location.direction` | `location.direction.cardinal` or `location.direction.ordinal` |
438+
| `location.direction_abbr` | `location.direction.cardinal_abbr` or `location.direction.ordinal_abbr` |
439+
440+
#### Default country definitions removed
428441

429442
The `faker.definitions.location.default_country` definition has been removed, as they were not used by any public method, and were not useful for locales which don't correspond directly to a single country, like `ar`.
430443

docs/guide/upgrading_v9/2476.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)