Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

moddle-xml

Package Overview
Dependencies
Maintainers
9
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moddle-xml - npm Package Compare versions

Comparing version 11.0.0-exp.1 to 11.0.0-exp.2

68

dist/index.esm.js

@@ -388,2 +388,40 @@ import { forEach, assign, find, isString, findIndex, filter, has } from 'min-dash';

/**
* Returns a property with an effective type descriptor,
* in case type is defined through xml -> serialize hint.
*
* @param {any} node parsed
* @param {PropertyDescriptor} property
*
* @return {PropertyDescriptor|null}
*/
ElementHandler.prototype.getSerializeAsTypePropertyForNode = function(node, property) {
const model = this.model;
const serializationType = getSerializationType(property);
if (!serializationType) {
return null;
}
const elementTypeName = node.attributes[serializationType];
// type is optional, if it does not exists the
// default type is assumed
if (elementTypeName) {
// convert the prefix used to the mapped form, but also
// take possible type prefixes from XML
// into account, i.e.: xsi:type="t{ActualType}",
const normalizedTypeName = normalizeTypeName(elementTypeName, node.ns, model);
const elementType = model.getType(normalizedTypeName);
return assign({}, property, {
effectiveType: getModdleDescriptor(elementType).name
});
}
};
ElementHandler.prototype.getPropertyForNode = function(node) {

@@ -404,29 +442,6 @@

if (property && !property.isAttr) {
const serializationType = getSerializationType(property);
if (serializationType) {
const elementTypeName = node.attributes[serializationType];
// type is optional, if it does not exists the
// default type is assumed
if (elementTypeName) {
// convert the prefix used to the mapped form, but also
// take possible type prefixes from XML
// into account, i.e.: xsi:type="t{ActualType}",
const normalizedTypeName = normalizeTypeName(elementTypeName, node.ns, model);
const elementType = model.getType(normalizedTypeName);
return assign({}, property, {
effectiveType: getModdleDescriptor(elementType).name
});
}
}
// search for properties by name first
return property;
return this.getSerializeAsTypePropertyForNode(node, property) || property;
}
// search by properties by type
var pkg = model.getPackage(nameNs.prefix);

@@ -444,6 +459,7 @@

if (property) {
return assign({}, property, {
return this.getSerializeAsTypePropertyForNode(node, property) || assign({}, property, {
effectiveType: getModdleDescriptor(elementType).name
});
}
} else {

@@ -450,0 +466,0 @@

{
"name": "moddle-xml",
"version": "11.0.0-exp.1",
"version": "11.0.0-exp.2",
"description": "XML import/export for documents described with moddle",

@@ -5,0 +5,0 @@ "scripts": {

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

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