Commit 6edbd54
refactor(js): derive VALID_REACTIONS from REACTION_MAP to remove duplication
- add_reaction_and_edit_comment.cjs: remove hardcoded VALID_REACTIONS array
and derive it from the exported REACTION_MAP from add_reaction.cjs.
This eliminates a duplicate list that could drift out of sync.
- add_reaction.cjs: remove transient validReactions local variable;
validate directly against REACTION_MAP using hasOwnProperty.
Behavior is unchanged — key order is preserved (insertion order matches
the original frozen array), and all 105 JS tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 23829db commit 6edbd54
2 files changed
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments