aboutsummaryrefslogtreecommitdiff
path: root/docs/guide
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guide')
-rw-r--r--docs/guide/upgrading_v9/2685.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/guide/upgrading_v9/2685.md b/docs/guide/upgrading_v9/2685.md
new file mode 100644
index 00000000..7e05fac6
--- /dev/null
+++ b/docs/guide/upgrading_v9/2685.md
@@ -0,0 +1,16 @@
+### Usage of TypeScript 5 Features
+
+_This upgrade is an extension to_ [#1953](./1953.md)
+
+The helpers module now uses TS5 features, so if you are using Faker with TypeScript, you must use TS5.
+
+```ts
+// v8
+faker.helpers.arrayElement([1, 2, 3]); // number
+faker.helpers.arrayElement([1, 2, 3] as const); // 1 | 2 | 3
+
+// v9
+faker.helpers.arrayElement([1, 2, 3]); // 1 | 2 | 3
+```
+
+If you are unable to upgrade to TS5, you have to keep using Faker v8.