Socket
Socket
Sign inDemoInstall

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 1.1.0 to 2.0.0

test/fixtures/example_source_attr12.xliff

4

jsToXliff12.js

@@ -23,5 +23,3 @@ const xml2js = require('xml2js');

xmlns: 'urn:oasis:names:tc:xliff:document:1.2',
version: '1.2',
srcLang: obj.sourceLanguage,
trgLang: obj.targetLanguage
version: '1.2'
},

@@ -28,0 +26,0 @@ file: []

{
"name": "xliff",
"version": "1.1.0",
"version": "2.0.0",
"description": "xliff2js and js2xliff converter xliff utils",

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

@@ -12,2 +12,6 @@ const fs = require('fs');

},
example_source_attr: {
// The JS should be the same as example.js
xliff12: fs.readFileSync(path.join(__dirname, 'example_source_attr12.xliff')).toString().replace(/\n$/, ''),
},
example_multi: {

@@ -14,0 +18,0 @@ js: require('./example_multi.json'),

@@ -37,2 +37,10 @@ const expect = require('expect.js');

test('jsToXliff12', (fn) => (done) => {
fn(fixtures.example.js, (err, res) => {
expect(err).not.to.be.ok();
expect(res).to.eql(fixtures.example.xliff12);
done();
});
});
test('targetOfjs', (fn) => (done) => {

@@ -84,2 +92,14 @@ fn(fixtures.example.js, (err, res) => {

describe('xliff 1.2 source/target attributes', () => {
test('xliff12ToJs', (fn) => (done) => {
fn(fixtures.example_source_attr.xliff12, (err, res) => {
expect(err).not.to.be.ok();
expect(res).to.eql(fixtures.example.js);
done();
});
});
});
describe('multi', () => {

@@ -86,0 +106,0 @@

@@ -20,4 +20,4 @@ const xml2js = require('xml2js');

const srcLang = data.xliff.$.srcLang;
const trgLang = data.xliff.$.trgLang;
const srcLang = data.xliff.file[0].$['source-language'];
const trgLang = data.xliff.file[0].$['target-language'];

@@ -24,0 +24,0 @@ result.sourceLanguage = srcLang;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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