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.0 to 4.1.1

6

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

@@ -10,6 +10,6 @@ "main": "index.js",

"dependencies": {
"xml-js": "1.6.7"
"xml-js": "1.6.8"
},
"devDependencies": {
"eslint": "^5.6.0",
"eslint": "^5.9.0",
"expect.js": "^0.3.1",

@@ -16,0 +16,0 @@ "mocha": "^5.0.5"

@@ -24,36 +24,38 @@ const convert = require('xml-js');

const srcLang = xliffRoot.attributes['srcLang'];
const trgLang = xliffRoot.attributes['trgLang'];
if (xliffRoot.attributes) {
const srcLang = xliffRoot.attributes['srcLang'];
const trgLang = xliffRoot.attributes['trgLang'];
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
result.resources = xliffRoot.elements.reduce((resources, file) => {
const namespace = file.attributes.id;
result.resources = xliffRoot.elements.reduce((resources, file) => {
const namespace = file.attributes.id;
// namespace
resources[namespace] = file.elements.reduce((file, unit) => {
const key = unit.attributes.id;
// namespace
resources[namespace] = file.elements.reduce((file, unit) => {
const key = unit.attributes.id;
// source, target, note
file[key] = unit.elements.reduce((unit, segment) => {
segment.elements.forEach((element) => {
switch (element.name) {
case 'source':
case 'target':
case 'note':
unit[element.name] = extractValue(element.elements, ElementTypes2);
break;
}
});
// source, target, note
file[key] = unit.elements.reduce((unit, segment) => {
segment.elements.forEach((element) => {
switch (element.name) {
case 'source':
case 'target':
case 'note':
unit[element.name] = extractValue(element.elements, ElementTypes2);
break;
}
});
return unit;
}, { source: '', target: '' });
return unit;
}, { source: '', target: '' });
return file;
return file;
}, {});
return resources;
}, {});
}
return resources;
}, {});
if (cb) return cb(null, result);

@@ -60,0 +62,0 @@ return result;

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