File tree Expand file tree Collapse file tree 1 file changed +4
-18
lines changed
Expand file tree Collapse file tree 1 file changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -325,27 +325,13 @@ pingPromisified = nodbUtil.promisify(ping);
325325
326326// create a subscription which can be used to get notifications of database
327327// changes
328- function subscribe ( name , a2 , a3 ) {
328+ function subscribe ( name , options , subscribeCb ) {
329329 var self = this ;
330- var options = { } ;
331- var subscribeCb ;
332330
333- nodbUtil . assert ( arguments . length >= 2 && arguments . length < = 3 , 'NJS-009' ) ;
331+ nodbUtil . assert ( arguments . length = = 3 , 'NJS-009' ) ;
334332 nodbUtil . assert ( typeof name === 'string' , 'NJS-006' , 1 ) ;
335-
336- switch ( arguments . length ) {
337- case 2 :
338- nodbUtil . assert ( typeof a2 === 'function' , 'NJS-006' , 2 ) ;
339- subscribeCb = a2 ;
340- break ;
341- case 3 :
342- nodbUtil . assert ( nodbUtil . isObject ( a2 ) , 'NJS-006' , 2 ) ;
343- nodbUtil . assert ( typeof a3 === 'function' , 'NJS-006' , 3 ) ;
344- options = a2 ;
345- subscribeCb = a3 ;
346- break ;
347- }
348-
333+ nodbUtil . assert ( nodbUtil . isObject ( options ) , 'NJS-006' , 2 ) ;
334+ nodbUtil . assert ( typeof subscribeCb === 'function' , 'NJS-006' , 3 ) ;
349335 self . _subscribe . call ( self , name , options , subscribeCb ) ;
350336}
351337
You can’t perform that action at this time.
0 commit comments