File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,9 @@ const getKeys = (cache, pattern) => new Promise((resolve) => {
1818const get = ( cache , key ) => cache . getAndPassUp ( key )
1919
2020const deleteKeys = ( stores , patterns ) => {
21- patterns = patterns . map ( pattern => pattern . endsWith ( '*' )
22- ? pattern
23- : [ pattern , pattern + DATA_POSTFIX ]
24- ) . reduce ( ( acc , item ) => {
25- if ( Array . isArray ( item ) ) {
26- acc . push ( ...item )
27- } else {
28- acc . push ( item )
29- }
30-
31- return acc
32- } , [ ] )
21+ patterns = patterns . map ( pattern =>
22+ pattern . endsWith ( '*' ) ? pattern : [ pattern , pattern + DATA_POSTFIX ]
23+ ) . flat ( )
3324
3425 patterns . forEach ( pattern => stores . forEach ( store => getKeys ( store , pattern ) . then ( keys => keys . length > 0 ? store . del ( keys ) : null ) ) )
3526}
You can’t perform that action at this time.
0 commit comments