final-form / final-form/react-final-form

Not possible to set numeric keys, even with multiple numbers like "5.1.1", on an object

Open
#1,042 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

![image](https://github.com/user-attachments/assets/24653cdc-745b-41f4-865f-884043a59059)

My keys have multiple numbers seperated by dot.

In this check:
![image](https://github.com/user-attachments/assets/59e82092-e554-4c6e-afe8-fda02694e86b)
the isNaN return false. We should only check for positive whole numbers here, all other numbers are not valid array indexes.

But I also wonder why its not allowed to set a numeric key in an object at all. Its not going against any JS rules. It should be possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.