1- const uuid = require ( 'node- uuid' ) ;
1+ const { v4 : uuid } = require ( 'uuid' ) ;
22const { once } = require ( 'arsenal' ) . jsutil ;
33const { deserializeBigInts, serializeBigInts } = require ( './utils/utils' ) ;
44
@@ -21,9 +21,9 @@ class CountWorkerObj {
2121 }
2222 } ) ;
2323 this . _worker . on ( 'message' , data => {
24- if ( data . owner !== 'scality' ) return ;
24+ if ( data . owner !== 'scality' ) { return ; }
2525 const cb = this . _getCallback ( data . id ) ;
26- if ( ! cb ) return ;
26+ if ( ! cb ) { return ; }
2727 switch ( data . type ) {
2828 case 'setup' :
2929 if ( data . status === 'passed' ) {
@@ -81,7 +81,7 @@ class CountWorkerObj {
8181 }
8282
8383 _getCallback ( id ) {
84- if ( ! this . callbacks . has ( id ) ) return null ;
84+ if ( ! this . callbacks . has ( id ) ) { return null ; }
8585 const ret = this . callbacks . get ( id ) ;
8686 this . callbacks . delete ( id ) ;
8787 return ret . callback ;
@@ -95,7 +95,7 @@ class CountWorkerObj {
9595 }
9696
9797 setup ( callback ) {
98- const id = uuid . v4 ( ) ;
98+ const id = uuid ( ) ;
9999 this . _addCallback ( id , 'setup' , callback ) ;
100100 this . _worker . send ( {
101101 id,
@@ -108,7 +108,7 @@ class CountWorkerObj {
108108 if ( ! this . clientConnected || ! this . _worker . isConnected ( ) ) {
109109 return callback ( ) ;
110110 }
111- const id = uuid . v4 ( ) ;
111+ const id = uuid ( ) ;
112112 this . _addCallback ( id , 'teardown' , callback ) ;
113113 return this . _worker . send ( {
114114 id,
@@ -118,7 +118,7 @@ class CountWorkerObj {
118118 }
119119
120120 count ( bucketInfo , callback ) {
121- const id = uuid . v4 ( ) ;
121+ const id = uuid ( ) ;
122122 this . _addCallback ( id , 'count' , ( err , results ) => {
123123 if ( err ) {
124124 return callback ( err ) ;
0 commit comments