Comparing version 4.0.0 to 4.1.0
@@ -10,2 +10,6 @@ const createjs = require('./createjs'); | ||
if (!cb) { | ||
return js2xliff(createjs(srcLng, trgLng, srcKeys, trgKeys, ns)); | ||
} | ||
createjs(srcLng, trgLng, srcKeys, trgKeys, ns, (err, res) => { | ||
@@ -12,0 +16,0 @@ if (err) return cb(err); |
@@ -10,2 +10,6 @@ const createjs = require('./createjs'); | ||
if (!cb) { | ||
return jsToXliff12(createjs(srcLng, trgLng, srcKeys, trgKeys, ns)); | ||
} | ||
createjs(srcLng, trgLng, srcKeys, trgKeys, ns, (err, res) => { | ||
@@ -12,0 +16,0 @@ if (err) return cb(err); |
{ | ||
"name": "xliff", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "xliff2js and js2xliff converter xliff utils", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "^4.4.1", | ||
"eslint": "^5.6.0", | ||
"expect.js": "^0.3.1", | ||
@@ -16,0 +16,0 @@ "mocha": "^5.0.5" |
@@ -79,2 +79,5 @@ [![travis](https://img.shields.io/travis/locize/xliff.svg)](https://travis-ci.org/locize/xliff) [![npm](https://img.shields.io/npm/v/xliff.svg)](https://npmjs.org/package/xliff) | ||
}); | ||
// or without callback | ||
const res = xliff2js(xliff); | ||
// res is like js | ||
@@ -85,2 +88,5 @@ const js2xliff = require('xliff/js2xliff'); | ||
}); | ||
// or without callback | ||
const res = js2xliff(js); | ||
// res is like xliff | ||
@@ -96,2 +102,10 @@ const targetOfjs = require('xliff/targetOfjs'); | ||
}); | ||
// or without callback | ||
const res = targetOfjs(js); | ||
// res is: | ||
// { | ||
// "key1": "Hallo", | ||
// "key2": "Eine Applikation um XLIFF Dokumente zu manipulieren und verarbeiten", | ||
// "key.nested": "XLIFF Daten Manager" | ||
// } | ||
@@ -107,2 +121,10 @@ const sourceOfjs = require('xliff/sourceOfjs'); | ||
}); | ||
// or without callback | ||
const res = sourceOfjs(js); | ||
// res is: | ||
// { | ||
// "key1": "Hello", | ||
// "key2": "An application to manipulate and process XLIFF documents", | ||
// "key.nested": "XLIFF Data Manager" | ||
// } | ||
@@ -127,3 +149,6 @@ const createjs = require('xliff/createjs'); | ||
}); | ||
// or without callback | ||
//const res = createjs(... | ||
const createxliff = require('xliff/createxliff'); | ||
@@ -147,2 +172,4 @@ createxliff( | ||
}); | ||
// or without callback | ||
//const res = createxliff(... | ||
``` | ||
@@ -198,2 +225,4 @@ | ||
}); | ||
// or without callback | ||
//const res = xliff12ToJs(... | ||
@@ -204,2 +233,4 @@ const jsToXliff12 = require('xliff/jsToXliff12'); | ||
}); | ||
// or without callback | ||
//const res = jsToXliff12(... | ||
@@ -224,4 +255,5 @@ const createxliff12 = require('xliff/createxliff12'); | ||
}); | ||
// or without callback | ||
//const res = createxliff12(... | ||
``` | ||
@@ -228,0 +260,0 @@ |
@@ -7,3 +7,5 @@ const convert = require('xml-js'); | ||
if (typeof str !== 'string') { | ||
return cb(new Error('The first parameter was not a string')); | ||
const err = new Error('The first parameter was not a string'); | ||
if (cb) return cb(err); | ||
return err; | ||
} | ||
@@ -17,3 +19,4 @@ | ||
} catch (err) { | ||
return cb(err); | ||
if (cb) return cb(err); | ||
return err; | ||
} | ||
@@ -58,5 +61,6 @@ | ||
cb(null, result); | ||
if (cb) return cb(null, result); | ||
return result; | ||
} | ||
module.exports = xliff12ToJs; |
@@ -7,3 +7,5 @@ const convert = require('xml-js'); | ||
if (typeof str !== 'string') { | ||
return cb(new Error('The first parameter was not a string')); | ||
const err = new Error('The first parameter was not a string'); | ||
if (cb) return cb(err); | ||
return err; | ||
} | ||
@@ -17,3 +19,4 @@ | ||
} catch (err) { | ||
return cb(err); | ||
if (cb) return cb(err); | ||
return err; | ||
} | ||
@@ -57,5 +60,6 @@ | ||
cb(null, result); | ||
if (cb) return cb(null, result); | ||
return result; | ||
} | ||
module.exports = xliffToJs; |
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
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
90897
1409
498
73