Closed
Description
Hi, thank you for sharing!
I think there's a paranthesis here put in the wrong place:
const patterns = keysPattern.split(',').map(
pattern => pattern.endsWith('*') ? pattern : [pattern, pattern + DATA_POSTFIX]) //<--here
.reduce((acc, item) =>
{
acc.push(...item)
return acc
}, [])
If the pattern is
*/test*
the reduce would make this an array of char.
The first character (*) is then passed to getkeys, deleting the entire database.
I fixed it in this way
const patterns = keysPattern.split(',').map(
pattern => pattern.endsWith('*') ? pattern : [pattern, pattern + DATA_POSTFIX]
.reduce((acc, item) =>
{
acc.push(...item)
return acc
}, [])) <--here
I wrong something?
Metadata
Metadata
Assignees
Labels
No labels