-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript declarations, RemoveEmptyLines, TrimLines, InsertFinalNewLine #33
Conversation
@scripthunter7 thank you for the contribution! @tvinzz will take care of it. |
src/transformations/trim-lines.js
Outdated
* @returns {Array<string>} filtered lines/rules | ||
*/ | ||
function trimLines(lines) { | ||
const transformed = lines.map((line) => _.trim(line, [' ', '\t'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scripthunter7 lodash _.trim
function for the second argument takes string, not array
with the array, it implicitly trims commas in the lines too, though there are no such cases in the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix
RemoveEmptyLines
TrimLines
InsertFinalNewLine
Test example
Input file
test.txt
:Test script:
hostlist-compiler-test.ts
Output file
test-output.txt
:"Real life" usage
hufilter-dns.ts
:Related issues