Skip to content

Commit f567ecb

Browse files
committed
WSE-109 - Minor fix
1 parent d087564 commit f567ecb

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

vss-extension.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifestVersion": 1,
33
"id": "whitesource",
4-
"version": "0.2.31",
4+
"version": "17.12.2",
55
"name": "WhiteSource",
66
"description": "Detect & fix security vulnerabilities, problematic open source licenses and quality issues.",
77
"publisher": "whitesource",

whitesource/HashCalculator.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function checkIfFileIsBinary(fileName) {
4242
if (BINARY_FILE_EXTENSION_REGEX == null) {
4343
BINARY_FILE_EXTENSION_REGEX = FileExtensions.buildBinaryRegex();
4444
}
45-
tl.debug(BINARY_FILE_EXTENSION_REGEX);
4645
return fileName.toLowerCase().match(BINARY_FILE_EXTENSION_REGEX);
4746
}
4847

@@ -103,9 +102,9 @@ function getSha1(path) {
103102
var otherPlatformSha1 = null;
104103
if (getFileSizeInBytes(path) < constants.MAX_FILE_SIZE) {
105104
var fileDataString = fileData.toString();
106-
if (fileDataString.indexOf(constants.CRLF)) {
105+
if (fileDataString.indexOf(constants.CRLF) >= 0) {
107106
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) {
109108
otherPlatformSha1 = getSha1FromData(fileDataString.replace(new RegExp(constants.NOT_CRLF, 'g'), constants.CRLF));
110109
}
111110
}
@@ -122,14 +121,4 @@ function getSha1FromData(bufferData) {
122121
function getFileSizeInBytes(filePath) {
123122
var stats = fs.statSync(filePath);
124123
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-
135124
}

whitesource/WssTask.js

-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ function getDependencyInfo(fileName, path, modified) {
361361
"fullHash": (hashCalculationResult == null) ? null : hashCalculationResult.fullHash,
362362
"mostSigBitsHash": (hashCalculationResult == null) ? null : hashCalculationResult.mostSigBitsHash,
363363
"leastSigBitsHash": (hashCalculationResult == null) ? null : hashCalculationResult.leastSigBitsHash,
364-
"otherPlatformSha1": "",
365364
"systemPath": path,
366365
"optional": false,
367366
"children": [],

whitesource/task.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
],
1111
"author": "WhiteSource",
1212
"version": {
13-
"Major": 0,
14-
"Minor": 1,
15-
"Patch": 39
13+
"Major": 17,
14+
"Minor": 12,
15+
"Patch": 2
1616
},
1717
"demands": [
1818
"node.js"

0 commit comments

Comments
 (0)