Skip to content

Commit

Permalink
chapter 04: adding a parameter that allows to pass an object webServi…
Browse files Browse the repository at this point in the history
…ce to logAnalyzer
  • Loading branch information
devcorpio committed Jan 12, 2019
1 parent ae67788 commit 8b1bdd8
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const ArgumentError = require('./errors/ArgumentError');

function logAnalyzer(extensionManager) {
function logAnalyzer(extensionManager, webService) {
/**
* @type {boolean}
*/
Expand Down Expand Up @@ -34,9 +34,19 @@ function logAnalyzer(extensionManager) {
return true;
}

/**
* @param {string} fileName
*/
function analyze(fileName) {
if (fileName.length < 8) {
webService.logError(`Filename too short: ${fileName}`);
}
}

return {
getWasLastFileNameValid,
isValidLogFileName,
analyze,
};
}

Expand Down

0 comments on commit 8b1bdd8

Please sign in to comment.