Skip to content

Commit b51e428

Browse files
authored
Fix timesInARow rule for textareas — they use arrays for values
Had to convert values to strings to compare properly. This might cause issues with objects as they all be converted to `"[object Object]"`, but we don't have such format for usual result.
1 parent 2093bc2 commit b51e428

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pausing_annotator/pause.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const rules = {
22
timesInARow: (times) => (items, field) => {
33
if (items.length < times) return false
4-
const last = items.at(-1).values[field]
5-
return items.slice(-times).every((item) => item.values[field] === last)
4+
const last = String(items.at(-1).values[field])
5+
return items.slice(-times).every((item) => String(item.values[field]) === last)
66
? `Too many similar values for ${field}`
77
: false
88
},

0 commit comments

Comments
 (0)