aboutsummaryrefslogtreecommitdiff
path: root/src/gleam_stdlib.mjs
diff options
context:
space:
mode:
authorKero van Gelder <keroami@users.noreply.github.com>2022-12-08 22:42:33 +0100
committerGitHub <noreply@github.com>2022-12-08 21:42:33 +0000
commit03477e5f04dfc52d44dc02658d70cc94c66b8574 (patch)
treececef02b849334e2db0b8658790d25ea00a69bde /src/gleam_stdlib.mjs
parent39d5b221f7c28e76262fc7e8b0746152a46c97c5 (diff)
downloadgleam_stdlib-03477e5f04dfc52d44dc02658d70cc94c66b8574.tar.gz
gleam_stdlib-03477e5f04dfc52d44dc02658d70cc94c66b8574.zip
JS/Firefox: also match newlines in string.length and string.pop_grapheme (#385)
Diffstat (limited to 'src/gleam_stdlib.mjs')
-rw-r--r--src/gleam_stdlib.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs
index a3e6c13..cde1052 100644
--- a/src/gleam_stdlib.mjs
+++ b/src/gleam_stdlib.mjs
@@ -89,7 +89,7 @@ export function string_length(string) {
}
return i;
} else {
- return string.match(/./gu).length;
+ return string.match(/./gus).length;
}
}
@@ -111,7 +111,7 @@ export function pop_grapheme(string) {
if (iterator) {
first = iterator.next().value?.segment;
} else {
- first = string.match(/./u)?.[0];
+ first = string.match(/./us)?.[0];
}
if (first) {
return new Ok([first, string.slice(first.length)]);