Comparing version 1.1.0 to 2.0.0
@@ -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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
32002
32
598
1