We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42875ab commit 9c63a87Copy full SHA for 9c63a87
src/gleam_stdlib_decode_ffi.mjs
@@ -16,7 +16,7 @@ export function index(data, key) {
16
const key_is_int = Number.isInteger(key);
17
18
// Only elements 0-7 of lists can be indexed, negative indices are not allowed
19
- if (key_is_int && key < 8 && key >= 0 && data instanceof List) {
+ if (key_is_int && key >= 0 && key < 8 && data instanceof List) {
20
let i = 0;
21
for (const value of data) {
22
if (i === key) return new Ok(new Some(value));
0 commit comments