File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626
2727'use strict' ;
2828
29- const crypto = require ( 'crypto' ) ;
29+ const Crypto = require ( 'crypto' ) ;
3030const Fs = require ( 'fs' ) ;
3131const ReadStream = Fs . ReadStream ;
3232const Stream = require ( 'stream' ) ;
@@ -815,7 +815,7 @@ HttpFile.prototype.$$read = function() {
815815
816816HttpFile . prototype . md5 = function ( callback ) {
817817 var self = this ;
818- var md5 = crypto . createHash ( 'md5' ) ;
818+ var md5 = Crypto . createHash ( 'md5' ) ;
819819 var stream = Fs . createReadStream ( self . path ) ;
820820 stream . on ( 'data' , ( buffer ) => md5 . update ( buffer ) ) ;
821821 stream . on ( 'error' , function ( error ) {
Original file line number Diff line number Diff line change @@ -1449,7 +1449,6 @@ exports.encode = function(str) {
14491449 return '' ;
14501450
14511451 var type = typeof ( str ) ;
1452-
14531452 if ( type !== 'string' )
14541453 str = str . toString ( ) ;
14551454
@@ -1467,7 +1466,6 @@ exports.decode = function(str) {
14671466 return '' ;
14681467
14691468 var type = typeof ( str ) ;
1470-
14711469 if ( type !== 'string' )
14721470 str = str . toString ( ) ;
14731471
@@ -1493,9 +1491,7 @@ exports.parseInt = function(obj, def) {
14931491 if ( obj == null )
14941492 return def || 0 ;
14951493 var type = typeof ( obj ) ;
1496- if ( type === 'number' )
1497- return obj ;
1498- return ( type !== 'string' ? obj . toString ( ) : obj ) . parseInt ( ) ;
1494+ return type === 'number' ? obj : ( type !== 'string' ? obj . toString ( ) : obj ) . parseInt ( ) ;
14991495} ;
15001496
15011497exports . parseBool = exports . parseBoolean = function ( obj , def ) {
You can’t perform that action at this time.
0 commit comments