dmn-js-shared
Advanced tools
Comparing version 8.0.0-alpha.1 to 8.0.0
@@ -130,3 +130,3 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
if (err) { | ||
err = checkValidationError(err); | ||
err = checkDMNCompatibilityError(err, xml) || checkValidationError(err) || err; | ||
} | ||
@@ -597,2 +597,19 @@ | ||
function checkDMNCompatibilityError(err, xml) { | ||
// check if we can indicate opening of old DMN 1.1 or DMN 1.2 diagrams | ||
if (err.message !== 'failed to parse document as <dmn:Definitions>') { | ||
return null; | ||
} | ||
var olderDMNVersion = xml.indexOf('"http://www.omg.org/spec/DMN/20151101/dmn.xsd"') !== -1 && '1.1' || xml.indexOf('"http://www.omg.org/spec/DMN/20180521/MODEL/"') !== -1 && '1.2'; | ||
if (!olderDMNVersion) { | ||
return null; | ||
} | ||
err = new Error('unsupported DMN ' + olderDMNVersion + ' file detected; ' + 'only DMN 1.3 files can be opened'); | ||
console.error('Cannot open what looks like a DMN ' + olderDMNVersion + ' diagram. ' + 'Please refer to https://bpmn.io/l/dmn-compatibility.html ' + 'to learn how to make the toolkit compatible with older DMN files', err); | ||
return err; | ||
} | ||
function checkValidationError(err) { | ||
@@ -604,6 +621,7 @@ // check if we can help the user by indicating wrong DMN 1.3 xml | ||
if (match) { | ||
err.message = 'unparsable content <' + match[1] + '> detected; ' + 'this may indicate an invalid DMN 1.3 diagram file' + match[2]; | ||
if (!match) { | ||
return null; | ||
} | ||
err.message = 'unparsable content <' + match[1] + '> detected; ' + 'this may indicate an invalid DMN 1.3 diagram file' + match[2]; | ||
return err; | ||
@@ -610,0 +628,0 @@ } |
{ | ||
"name": "dmn-js-shared", | ||
"description": "Shared components used by dmn-js", | ||
"version": "8.0.0-alpha.1", | ||
"version": "8.0.0", | ||
"scripts": { | ||
@@ -34,3 +34,3 @@ "test": "karma start", | ||
}, | ||
"gitHead": "6aceb666c1e899749a5f966886a375825e4556b9" | ||
"gitHead": "2cff1b85d52e20f69bf6d11dfa4a8010b2d71f34" | ||
} |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
251397
2832
1