moddle-xml
Advanced tools
Comparing version 7.1.0 to 7.2.0
@@ -9,2 +9,4 @@ # Changelog | ||
* `FEAT`: warn on invalid attributes under well-known namespaces ([#32](https://github.com/bpmn-io/moddle-xml/issues/32)) | ||
## 7.1.0 | ||
@@ -11,0 +13,0 @@ |
@@ -302,3 +302,5 @@ import { | ||
context = this.context, | ||
instance = new Type({}); | ||
instance = new Type({}), | ||
model = this.model, | ||
propNameNs; | ||
@@ -334,2 +336,16 @@ forEach(attributes, function(value, name) { | ||
value = coerceType(prop.type, value); | ||
} else { | ||
propNameNs = parseNameNs(name, descriptor.ns.prefix); | ||
// check whether attribute is defined in a well-known namespace | ||
// if that is the case we emit a warning to indicate potential misuse | ||
if (model.getPackage(propNameNs.prefix)) { | ||
context.addWarning({ | ||
message: 'unknown attribute <' + name + '>', | ||
element: instance, | ||
property: name, | ||
value: value | ||
}); | ||
} | ||
} | ||
@@ -375,3 +391,5 @@ | ||
return assign({}, property, { effectiveType: getModdleDescriptor(elementType).name }); | ||
return assign({}, property, { | ||
effectiveType: getModdleDescriptor(elementType).name | ||
}); | ||
} | ||
@@ -396,3 +414,5 @@ } | ||
if (property) { | ||
return assign({}, property, { effectiveType: getModdleDescriptor(elementType).name }); | ||
return assign({}, property, { | ||
effectiveType: getModdleDescriptor(elementType).name | ||
}); | ||
} | ||
@@ -399,0 +419,0 @@ } else { |
{ | ||
"name": "moddle-xml", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "XML import/export for documents described with moddle", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
43771
1322