File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ module.exports = {
48
48
'operator-linebreak' : [ 'error' , 'after' ] ,
49
49
'linebreak-style' : 'off' ,
50
50
'no-confusing-arrow' : 'off' ,
51
+ 'no-restricted-syntax' : 'off' ,
51
52
'comma-dangle' : 'off' ,
52
53
'arrow-body-style' : 'warn' ,
53
54
'max-len' : [ 'error' , {
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ export default class Memory<T extends Draft> {
26
26
return this . _docs . delete ( _id ) ;
27
27
}
28
28
29
- all ( ) {
30
- return Array . from ( this . _docs . values ( ) ) ;
29
+ docs ( ) {
30
+ return this . _docs . values ( ) ;
31
31
}
32
32
33
33
flush ( ) {
Original file line number Diff line number Diff line change @@ -126,8 +126,7 @@ export default class LeafDB<T extends Draft> {
126
126
127
127
if ( ! isQuery ( query ) ) return Promise . reject ( INVALID_QUERY ( query ) ) ;
128
128
129
- for ( let i = 0 , docs = this . _memory . all ( ) ; i < docs . length ; i += 1 ) {
130
- const doc = docs [ i ] ;
129
+ for ( const doc of this . _memory . docs ( ) ) {
131
130
if ( ! doc . __deleted && isQueryMatch ( doc , query ) ) return Promise . resolve ( doc ) ;
132
131
}
133
132
@@ -147,10 +146,10 @@ export default class LeafDB<T extends Draft> {
147
146
}
148
147
if ( ! isQuery ( query ) ) return Promise . reject ( INVALID_QUERY ( query ) ) ;
149
148
150
- const docs = this . _memory . all ( ) . reduce < Array < Doc < T > > > ( ( acc , doc ) => {
151
- if ( ! doc . __deleted && isQueryMatch ( doc , query ) ) acc . push ( doc ) ;
152
- return acc ;
153
- } , [ ] ) ;
149
+ const docs : Array < Doc < T > > = [ ] ;
150
+ for ( const doc of this . _memory . docs ( ) ) {
151
+ if ( ! doc . __deleted && isQueryMatch ( doc , query ) ) docs . push ( doc ) ;
152
+ }
154
153
155
154
return Promise . resolve ( docs ) ;
156
155
}
You can’t perform that action at this time.
0 commit comments