Open Mirantus opened 6 years ago
It's doesnt work on Windows when files have file encodings with '\n'. os.EOL returns '\n\r' so we have array sourceByLine as one string instead of multivalues. Then commentCodeInsideBlocks can't find this big string in truthyBlocks and nothing do.
I would suggest to use the regular expression /[\r\n]+/g to detect end of lines:
const sourceByLine = source.split(/[\r\n]+/g)
It's doesnt work on Windows when files have file encodings with '\n'. os.EOL returns '\n\r' so we have array sourceByLine as one string instead of multivalues. Then commentCodeInsideBlocks can't find this big string in truthyBlocks and nothing do.