From f4aef77da869420f6ea147ff2ef644b0d2c839ac Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Tue, 4 Jun 2024 12:22:29 +0700 Subject: [PATCH 1/2] docs: document breaking changes for #2476 into migration guide --- docs/guide/upgrading.md | 15 ++++++++++++++- docs/guide/upgrading_v9/2476.md | 12 ------------ 2 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 docs/guide/upgrading_v9/2476.md diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md index 653570b6eba..ba30e0b8356 100644 --- a/docs/guide/upgrading.md +++ b/docs/guide/upgrading.md @@ -424,7 +424,20 @@ Removed deprecated location methods | `faker.location.ordinalDirection(abbreviated)` | `faker.location.ordinalDirection({ abbreviated })` | | `faker.location.nearbyGPSCoordinate(coordinate, radius, isMetric)` | `faker.location.nearbyGPSCoordinate({ origin, radius, isMetric })` | -#### Removed Definitions +#### Direction definitions reorganized + +The locale definitions used by `faker.location.direction()`, `faker.location.cardinalDirection()` and `faker.location.ordinalDirection()` have been reorganized. +Previously, they were organized under `definitions.location.direction` and `definitions.location.direction_abbr` and where values were required to be in a specific order. +Now, all values are nested under `definitions.location.direction` with descriptive property names. +If you are using the public methods, no changes are required. +You only need to change your code if you are accessing the raw definitions e.g. in `faker.helpers.fake()`. + +| Before | After | +| ------------------------- | ----------------------------------------------------------------------- | +| `location.direction` | `location.direction.cardinal` or `location.direction.ordinal` | +| `location.direction_abbr` | `location.direction.cardinal_abbr` or `location.direction.ordinal_abbr` | + +#### Default country definitions removed 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`. diff --git a/docs/guide/upgrading_v9/2476.md b/docs/guide/upgrading_v9/2476.md deleted file mode 100644 index b1ee78f8330..00000000000 --- a/docs/guide/upgrading_v9/2476.md +++ /dev/null @@ -1,12 +0,0 @@ -### Direction definitions reorganized - -The locale definitions used by `faker.location.direction()`, `faker.location.cardinalDirection()` and `faker.location.ordinalDirection()` have been reorganized. -Previously, they were organized under `definitions.location.direction` and `definitions.location.direction_abbr` and where values were required to be in a specific order. -Now, all values are nested under `definitions.location.direction` with descriptive property names. -If you are using the public methods, no changes are required. -You only need to change your code if you are accessing the raw definitions e.g. in `faker.helpers.fake()`. - -| Before | After | -| ------------------------- | ----------------------------------------------------------------------- | -| `location.direction` | `location.direction.cardinal` or `location.direction.ordinal` | -| `location.direction_abbr` | `location.direction.cardinal_abbr` or `location.direction.ordinal_abbr` | From 5ac8ec97955650719b20d81b95ea589ebe4f47f5 Mon Sep 17 00:00:00 2001 From: Matt Mayer <152770+matthewmayer@users.noreply.github.com> Date: Wed, 12 Jun 2024 18:17:52 +0700 Subject: [PATCH 2/2] Update upgrading.md Co-authored-by: DivisionByZero --- docs/guide/upgrading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md index ba30e0b8356..81a48ad8bed 100644 --- a/docs/guide/upgrading.md +++ b/docs/guide/upgrading.md @@ -427,7 +427,7 @@ Removed deprecated location methods #### Direction definitions reorganized The locale definitions used by `faker.location.direction()`, `faker.location.cardinalDirection()` and `faker.location.ordinalDirection()` have been reorganized. -Previously, they were organized under `definitions.location.direction` and `definitions.location.direction_abbr` and where values were required to be in a specific order. +Previously, they were located under `definitions.location.direction` and `definitions.location.direction_abbr` and their values were required to be in a specific order. Now, all values are nested under `definitions.location.direction` with descriptive property names. If you are using the public methods, no changes are required. You only need to change your code if you are accessing the raw definitions e.g. in `faker.helpers.fake()`.