File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -132,24 +132,24 @@ describe('mongoose-cursor-pagination', () => {
132
132
}
133
133
)
134
134
. then ( results => {
135
- should . equal ( results . items . length , 5 )
136
- should . equal ( results . hasMore , true )
137
- should . equal ( results . items [ 0 ] . value , 994 )
138
- should . equal ( results . items [ 4 ] . value , 990 )
139
- } )
140
- } )
135
+ should . equal ( results . items . length , 5 ) ;
136
+ should . equal ( results . hasMore , true ) ;
137
+ should . equal ( results . items [ 0 ] . value , 994 ) ;
138
+ should . equal ( results . items [ 4 ] . value , 990 ) ;
139
+ } ) ) ;
141
140
142
- it ( 'does not modify the provided query object' , function ( ) {
141
+ it ( 'does not modify the provided query object' , ( ) => {
143
142
const query = { } ;
144
143
145
- return mongoose . model ( 'User' ) . paginate ( query , {
146
- key : 'value' ,
147
- sort : { value : - 1 } ,
148
- endingBefore : 995 ,
149
- } )
150
- . then ( ( ) => {
151
- query . should . eql ( { } )
144
+ return mongoose
145
+ . model ( 'User' )
146
+ . paginate ( query , {
147
+ key : 'value' ,
148
+ sort : { value : - 1 } ,
149
+ endingBefore : 995 ,
152
150
} )
153
- } )
151
+ . then ( ( ) => {
152
+ query . should . eql ( { } ) ;
153
+ } ) ;
154
+ } ) ;
154
155
} ) ;
155
-
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export default function paginationPlugin(schema, pluginOptions) {
12
12
} ;
13
13
14
14
schema . statics . paginate = function ( query , options , callback ) {
15
- query = query ? { ...query } : { } ;
15
+ query = query ? { ...query } : { } ;
16
16
options = options || { } ;
17
17
options . limit = + options . limit || defaultOptions . limit ;
18
18
options = { ...defaultOptions , ...options } ;
You can’t perform that action at this time.
0 commit comments