@@ -42,7 +42,6 @@ function checkIfFileIsBinary(fileName) {
42
42
if ( BINARY_FILE_EXTENSION_REGEX == null ) {
43
43
BINARY_FILE_EXTENSION_REGEX = FileExtensions . buildBinaryRegex ( ) ;
44
44
}
45
- tl . debug ( BINARY_FILE_EXTENSION_REGEX ) ;
46
45
return fileName . toLowerCase ( ) . match ( BINARY_FILE_EXTENSION_REGEX ) ;
47
46
}
48
47
@@ -103,9 +102,9 @@ function getSha1(path) {
103
102
var otherPlatformSha1 = null ;
104
103
if ( getFileSizeInBytes ( path ) < constants . MAX_FILE_SIZE ) {
105
104
var fileDataString = fileData . toString ( ) ;
106
- if ( fileDataString . indexOf ( constants . CRLF ) ) {
105
+ if ( fileDataString . indexOf ( constants . CRLF ) >= 0 ) {
107
106
otherPlatformSha1 = getSha1FromData ( fileDataString . replace ( new RegExp ( constants . CRLF , 'g' ) , constants . NOT_CRLF ) ) ;
108
- } else if ( fileDataString . indexOf ( constants . NOT_CRLF ) ) {
107
+ } else if ( fileDataString . indexOf ( constants . NOT_CRLF ) >= 0 ) {
109
108
otherPlatformSha1 = getSha1FromData ( fileDataString . replace ( new RegExp ( constants . NOT_CRLF , 'g' ) , constants . CRLF ) ) ;
110
109
}
111
110
}
@@ -122,14 +121,4 @@ function getSha1FromData(bufferData) {
122
121
function getFileSizeInBytes ( filePath ) {
123
122
var stats = fs . statSync ( filePath ) ;
124
123
return stats [ "size" ] ;
125
- }
126
-
127
- function calculateJavaScriptHashes ( filePath ) {
128
- //TODO Add try & catch
129
- var fileData = fs . readFileSync ( filePath , { encoding : constants . UTF_8 } ) ;
130
- return getJavaScriptHashes ( converter . UTF8 . stringToBytes ( fileData ) ) ;
131
- }
132
-
133
- function getJavaScriptHashes ( arrayOfBytes ) {
134
-
135
124
}
0 commit comments