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 6.0.0 to 6.0.1

40

cjs/xliff12ToJs.js

@@ -43,19 +43,25 @@ "use strict";

});
var srcLang = xliffRoot.elements[0].attributes['source-language'];
var trgLang = xliffRoot.elements[0].attributes['target-language'];
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
if (!result.targetLanguage) delete result.targetLanguage;
result.resources = xliffRoot.elements.reduce(function (resources, file) {
var namespace = options.namespace || file.attributes.original;
var body = file.elements.find(function (e) {
return e.name === 'body';
});
body.elements = body.elements || [];
var bodyChildren = body.elements.filter(function (child) {
return child.type !== 'comment';
});
resources[namespace] = createUnits(bodyChildren);
return resources;
}, {});
if (xliffRoot.elements && xliffRoot.elements.length) {
var srcLang = xliffRoot.elements[0].attributes['source-language'];
var trgLang = xliffRoot.elements[0].attributes['target-language'];
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
if (!result.targetLanguage) delete result.targetLanguage;
result.resources = xliffRoot.elements.reduce(function (resources, file) {
var namespace = options.namespace || file.attributes.original;
var body = file.elements.find(function (e) {
return e.name === 'body';
});
body.elements = body.elements || [];
var bodyChildren = body.elements.filter(function (child) {
return child.type !== 'comment';
});
resources[namespace] = createUnits(bodyChildren);
return resources;
}, {});
} else {
result.resources = {};
}
if (cb) return cb(null, result);

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

@@ -32,19 +32,25 @@ import convert from 'xml-js';

});
var srcLang = xliffRoot.elements[0].attributes['source-language'];
var trgLang = xliffRoot.elements[0].attributes['target-language'];
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
if (!result.targetLanguage) delete result.targetLanguage;
result.resources = xliffRoot.elements.reduce(function (resources, file) {
var namespace = options.namespace || file.attributes.original;
var body = file.elements.find(function (e) {
return e.name === 'body';
});
body.elements = body.elements || [];
var bodyChildren = body.elements.filter(function (child) {
return child.type !== 'comment';
});
resources[namespace] = createUnits(bodyChildren);
return resources;
}, {});
if (xliffRoot.elements && xliffRoot.elements.length) {
var srcLang = xliffRoot.elements[0].attributes['source-language'];
var trgLang = xliffRoot.elements[0].attributes['target-language'];
result.sourceLanguage = srcLang;
result.targetLanguage = trgLang;
if (!result.targetLanguage) delete result.targetLanguage;
result.resources = xliffRoot.elements.reduce(function (resources, file) {
var namespace = options.namespace || file.attributes.original;
var body = file.elements.find(function (e) {
return e.name === 'body';
});
body.elements = body.elements || [];
var bodyChildren = body.elements.filter(function (child) {
return child.type !== 'comment';
});
resources[namespace] = createUnits(bodyChildren);
return resources;
}, {});
} else {
result.resources = {};
}
if (cb) return cb(null, result);

@@ -51,0 +57,0 @@ return result;

@@ -29,23 +29,27 @@ import convert from 'xml-js'

const srcLang = xliffRoot.elements[0].attributes['source-language']
const trgLang = xliffRoot.elements[0].attributes['target-language']
if (xliffRoot.elements && xliffRoot.elements.length) {
const srcLang = xliffRoot.elements[0].attributes['source-language']
const trgLang = xliffRoot.elements[0].attributes['target-language']
result.sourceLanguage = srcLang
result.targetLanguage = trgLang
if (!result.targetLanguage) delete result.targetLanguage
result.sourceLanguage = srcLang
result.targetLanguage = trgLang
if (!result.targetLanguage) delete result.targetLanguage
result.resources = xliffRoot.elements.reduce((resources, file) => {
const namespace = options.namespace || file.attributes.original
result.resources = xliffRoot.elements.reduce((resources, file) => {
const namespace = options.namespace || file.attributes.original
const body = file.elements.find((e) => e.name === 'body')
body.elements = body.elements || []
const bodyChildren = body.elements.filter(
(child) => child.type !== 'comment'
)
const body = file.elements.find((e) => e.name === 'body')
body.elements = body.elements || []
const bodyChildren = body.elements.filter(
(child) => child.type !== 'comment'
)
// namespace
resources[namespace] = createUnits(bodyChildren)
// namespace
resources[namespace] = createUnits(bodyChildren)
return resources
}, {})
return resources
}, {})
} else {
result.resources = {}
}

@@ -52,0 +56,0 @@ if (cb) return cb(null, result)

{
"name": "xliff",
"version": "6.0.0",
"version": "6.0.1",
"description": "xliff2js and js2xliff converter xliff utils",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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