Skip to content

Commit

Permalink
chapter 03: I created a seam in logAnalyzer, that seam enable the pos…
Browse files Browse the repository at this point in the history
…sibility of inject the dependency while are calling the function
  • Loading branch information
devcorpio committed Jan 11, 2019
1 parent 0c83251 commit 108928e
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const ArgumentError = require('./ArgumentError');
const fileExtensionManagerFactory = require('./fileExtensionManager');

const fileExtensionManager = fileExtensionManagerFactory();

function logAnalyzer() {
function logAnalyzer(extensionManager) {
/**
* @type {boolean}
*/
Expand All @@ -27,7 +24,7 @@ function logAnalyzer() {
throw new ArgumentError('filename has to be provided');
}

const result = await fileExtensionManager.isValid(fileName);
const result = await extensionManager.isValid(fileName);

if (!result) {
return false;
Expand Down

0 comments on commit 108928e

Please sign in to comment.