diff options
author | David Dios <david.dios@loveholidays.com> | 2024-08-10 19:12:33 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-08-14 11:24:17 +0200 |
commit | 9205a432dee3493e2545ee56f1e17d8bcdb7f5a5 (patch) | |
tree | 3d62cfe8c6cc2fb71757ee8d2b6d13b208eed55d | |
parent | 894bc951a0681bb80063e8c7c98c4c7f6ef5097e (diff) | |
download | gleam_stdlib-9205a432dee3493e2545ee56f1e17d8bcdb7f5a5.tar.gz gleam_stdlib-9205a432dee3493e2545ee56f1e17d8bcdb7f5a5.zip |
fail-safe Intl check
-rw-r--r-- | src/gleam_stdlib.mjs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs index 19a43b1..35d2f7d 100644 --- a/src/gleam_stdlib.mjs +++ b/src/gleam_stdlib.mjs @@ -156,7 +156,7 @@ export function graphemes(string) { } function graphemes_iterator(string) { - if (Intl && Intl.Segmenter) { + if (typeof Intl !== 'undefined' && Intl.Segmenter) { return new Intl.Segmenter().segment(string)[Symbol.iterator](); } } |