Corrected trimNewLine function to prevent build errors based on unescaped control character U+000D
This commit is contained in:
parent
80127d17fa
commit
36650a3f45
|
@ -41,11 +41,10 @@ function getDirectories (srcpath) {
|
|||
|
||||
String.prototype.trimNewline = function() {
|
||||
let string = this.toString();
|
||||
let match = '\r\n'
|
||||
if (string.endsWith('\r\n')) {
|
||||
return string.slice(0, -4);
|
||||
} else if (string.endsWith('\r') || string.endsWith('\n')) {
|
||||
return string.slice(0, -2);
|
||||
} else if (string.endsWith('\r') || string.endsWith('\n')) {
|
||||
return string.slice(0, -1);
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
|
|
Reference in New Issue