gettext-parser
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -55,2 +55,6 @@ const { Buffer } = require('safe-buffer'); | ||
if (!('eol' in this._options)) { | ||
this._options.eol = '\n'; | ||
} | ||
this._translations = []; | ||
@@ -97,3 +101,3 @@ | ||
return lines.join('\n'); | ||
return lines.join(this._options.eol); | ||
}; | ||
@@ -137,3 +141,3 @@ | ||
return response.join('\n'); | ||
return response.join(this._options.eol); | ||
}; | ||
@@ -161,4 +165,6 @@ | ||
if (this._options.foldLength > 0) { | ||
lines = sharedFuncs.foldLine(value, this._options.foldLength); | ||
const { foldLength, eol } = this._options; | ||
if (foldLength > 0) { | ||
lines = sharedFuncs.foldLine(value, foldLength); | ||
} | ||
@@ -170,3 +176,3 @@ | ||
return `${key} ""\n"${lines.join('"\n"')}"`; | ||
return `${key} ""${eol}"${lines.join(`"${eol}"`)}"`; | ||
}; | ||
@@ -218,5 +224,7 @@ | ||
if (this._options.sort !== false) { | ||
if (typeof this._options.sort === 'function') { | ||
response = response.sort(this._options.sort); | ||
const { sort, eol } = this._options; | ||
if (sort !== false) { | ||
if (typeof sort === 'function') { | ||
response = response.sort(sort); | ||
} else { | ||
@@ -234,6 +242,6 @@ response = response.sort(sharedFuncs.compareMsgid); | ||
if (this._table.charset === 'utf-8' || this._table.charset === 'ascii') { | ||
return Buffer.from(response.join('\n\n'), 'utf-8'); | ||
return Buffer.from(response.join(eol + eol), 'utf-8'); | ||
} | ||
return encoding.convert(response.join('\n\n'), this._table.charset); | ||
return encoding.convert(response.join(eol + eol), this._table.charset); | ||
}; |
{ | ||
"name": "gettext-parser", | ||
"description": "Parse and compile gettext po and mo files to/from json, nothing more, nothing less", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"author": "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50734
1184