MCPcopy
hub / github.com/vpulim/node-soap / ExtensionElement

Class ExtensionElement

src/wsdl/elements.ts:440–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440export class ExtensionElement extends Element {
441 public readonly allowedChildren = buildAllowedChildren(['all', 'choice', 'sequence']);
442 public $base: string;
443
444 public description(definitions: DefinitionsElement, xmlns?: IXmlNs) {
445 let desc = {};
446 for (const child of this.children) {
447 if (child instanceof SequenceElement || child instanceof ChoiceElement) {
448 desc = child.description(definitions, xmlns);
449 }
450 }
451 if (this.$base) {
452 const type = splitQName(this.$base);
453 const typeName = type.name;
454 const ns = findNs(type.prefix, xmlns, this.definitionsXmlns, definitions.xmlns);
455 const schema = definitions.schemas[ns];
456
457 if (typeName in Primitives) {
458 return this.$base;
459 } else {
460 const typeElement = schema && (schema.complexTypes[typeName] || schema.types[typeName] || schema.elements[typeName]);
461 if (typeElement) {
462 const base = typeElement.description(definitions, schema.xmlns);
463 desc = typeof base === 'string' ? base : defaults(base, desc);
464 }
465 }
466 }
467 return desc;
468 }
469}
470
471export class ChoiceElement extends Element {
472 public readonly allowedChildren = buildAllowedChildren(['any', 'choice', 'element', 'sequence']);

Callers

nothing calls this directly

Calls 1

buildAllowedChildrenFunction · 0.85

Tested by

no test coverage detected