File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 33var  domain  =  require ( 'domain' ) ; 
44var  EE  =  require ( 'events' ) . EventEmitter ; 
55
6+ var  eos  =  require ( 'end-of-stream' ) ; 
7+ 
68function  asyncDone ( fn ,  done ) { 
79  function  onSuccess ( result ) { 
810    return  done ( undefined ,  result ) ; 
@@ -21,7 +23,7 @@ function asyncDone(fn, done){
2123
2224    if ( result  &&  result  instanceof  EE ) { 
2325      d . add ( result ) ; 
24-       result . once ( 'end' ,   onSuccess ) . once ( 'close' ,  onSuccess ) ; 
26+       eos ( result ,   {   error :  false   } ,  onSuccess ) ; 
2527      return ; 
2628    } 
2729
Original file line number Diff line number Diff line change 1919    "url" : " https://github.com/phated/async-done/issues" 
2020  },
2121  "homepage" : " https://github.com/phated/async-done" 
22+   "dependencies" : {
23+     "end-of-stream" : " ^0.1.4" 
24+   },
2225  "devDependencies" : {
2326    "tap" : " ~0.4.8" 
2427    "through2" : " ~0.4.1" 
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ function failure(){
3030} 
3131
3232test ( 'handle a successful stream' ,  function ( t ) { 
33-   asyncDone ( success ,  function ( err ,   result ) { 
33+   asyncDone ( success ,  function ( err ) { 
3434    t . ok ( err  ==  null ,  'error should be null or undefined' ) ; 
35-     t . equal ( result ,  2 ,  'result should be 2' ) ; 
3635    t . end ( ) ; 
3736  } ) ; 
3837} ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments