@sap-ux/i18n
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -28,10 +28,15 @@ "use strict"; | ||
const content = yield (0, utils_1.readFile)(i18nFilePath, fs); | ||
const lines = content.split(/\r\n|\n/); | ||
// check if file does not end with new line | ||
if (lines.length > 0 && lines[lines.length - 1].trim()) { | ||
// If there no end line - add new gap line before new content | ||
newContent = `\n${newContent}`; | ||
if (content) { | ||
const lines = content.split(/\r\n|\n/); | ||
// check if file does not end with new line | ||
if (lines.length > 0 && lines[lines.length - 1].trim()) { | ||
// If there no end line - add new gap line before new content | ||
newContent = `\n${newContent}`; | ||
} | ||
yield (0, utils_1.writeFile)(i18nFilePath, content.concat(newContent), fs); | ||
return true; | ||
} | ||
yield (0, utils_1.writeFile)(i18nFilePath, content.concat(newContent), fs); | ||
return true; | ||
else { | ||
return false; | ||
} | ||
}); | ||
@@ -38,0 +43,0 @@ } |
{ | ||
"name": "@sap-ux/i18n", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Library for i18n", | ||
@@ -29,3 +29,3 @@ "repository": { | ||
"devDependencies": { | ||
"npm-run-all": "4.1.5", | ||
"npm-run-all2": "6.2.0", | ||
"@types/mem-fs-editor": "7.0.1", | ||
@@ -32,0 +32,0 @@ "@types/mem-fs": "1.1.2", |
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
142102
3320