Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xliff

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xliff - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

2

package.json
{
"name": "xliff",
"version": "4.1.2",
"version": "4.1.3",
"description": "xliff2js and js2xliff converter xliff utils",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -23,2 +23,14 @@ const expect = require('expect.js');

it('removes a trailing line break and space from a "formatted" XML text element', () => {
expect(extractValue({ type: 'text', text: 'Hello \n ' }, ElementTypes12)).to.eql('Hello ');
});
it('removes trailing line breaks from a "formatted" XML text element with an embedded line break', () => {
expect(extractValue({ type: 'text', text: 'Hello \n There\n ' }, ElementTypes12)).to.eql('Hello \n There');
});
it('does not throw away content from a "formatted" XML text element with no trailing line break', () => {
expect(extractValue({ type: 'text', text: 'Hello \n There' }, ElementTypes12)).to.eql('Hello \n There');
});
it('creates objects for all supported inline element types', () => {

@@ -25,0 +37,0 @@ const supportedElementTypes = Object.keys(ElementTypes);

@@ -22,3 +22,3 @@ const convert = require('xml-js');

const xliffRoot = xmlObj.elements[0];
const xliffRoot = xmlObj.elements.find((ele) => ele.name === 'xliff');

@@ -37,2 +37,4 @@ if (xliffRoot.attributes) {

resources[namespace] = file.elements.reduce((file, unit) => {
if (unit.name !== 'unit') return file;
const key = unit.attributes.id;

@@ -39,0 +41,0 @@

@@ -16,3 +16,6 @@ const tagToElementType = require('../inline-elements/typeToTagMaps').tagToElementType;

if (valueElement.type === 'text') {
return valueElement.text.indexOf('\n') === -1 ? valueElement.text : valueElement.text.substr(0, valueElement.text.lastIndexOf('\n'));
if (/\n\s*$/.test(valueElement.text)) {
return valueElement.text.substr(0, valueElement.text.lastIndexOf('\n'));
}
return valueElement.text;
}

@@ -19,0 +22,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc