All done. Please merge.#13
Open
dataluxe wants to merge 6 commits into
Open
Conversation
…ompact ReadFile function.
…liable <for>. Pushing critical changes.
izzybaer
reviewed
Dec 2, 2017
| paths = paths.map(x=>{return{'path':x, 'text':null};}); | ||
| // Map file array out into Object Array - each object has 'path' and 'text'. <text> defaults to null, <path> is the inputted path from the original array. | ||
|
|
||
| for (let i=0, len=paths.length; i<len; i++) { |
Contributor
There was a problem hiding this comment.
you need space between your operators
izzybaer
reviewed
Dec 2, 2017
|
|
||
| for (let i=0, len=paths.length; i<len; i++) { | ||
|
|
||
| //console.log(`Main 'for' loop started - ${new Date().getTime()}`);//REMOVE------- |
Contributor
There was a problem hiding this comment.
always delete commented out code and unnecessary console.logs
izzybaer
reviewed
Dec 2, 2017
|
|
||
| fs.readFile(paths[i].path, (error, data) => { | ||
|
|
||
| //console.log(`readFile callback's 'this': ${this}`); |
izzybaer
reviewed
Dec 2, 2017
| return; //First of two exit points for this function - remember, this function should return <undefined>, as this expression will. | ||
| } | ||
|
|
||
| //console.log(`File ${i} succesfully read! Characters returned: ${data.length}`);//REMOVE------- |
izzybaer
reviewed
Dec 2, 2017
| //console.log(`paths[${i}].text - ${paths[i].text}`); | ||
| //console.log(`paths: ${paths}`); | ||
|
|
||
| if (paths.filter(x=>{return x.text===null;}).length === 0) callback(null, paths.map(x=>{return x.text;})); |
Contributor
There was a problem hiding this comment.
for readability purposes you should separate these onto different lines and add spaces between operators.
izzybaer
reviewed
Dec 2, 2017
| ).toThrow(); | ||
| }); | ||
|
|
||
| test(`- : "<paths> is not populated with strings."`, () => { |
Contributor
There was a problem hiding this comment.
this test is the same as line 45
izzybaer
reviewed
Dec 2, 2017
| }); | ||
| }); | ||
|
|
||
| test(`- : "<paths> is not populated with strings."`, () => { |
Contributor
There was a problem hiding this comment.
you should change this test message, you already have a test message that is exactly the same as this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.