MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / _resolveNamespace

Method _resolveNamespace

packages/core/xml/index.ts:610–643  ·  view source on GitHub ↗
(fullName: string)

Source from the content-addressed store, hash-verified

608 }
609
610 private _resolveNamespace(fullName: string): { prefix: string; namespace: string; name: string } {
611 const result: { prefix: string; namespace: string; name: string } = {
612 prefix: undefined,
613 namespace: undefined,
614 name: undefined,
615 };
616 result.prefix = '';
617 if (fullName.indexOf(':') !== -1) {
618 const split = fullName.split(':');
619 result.prefix = split[0];
620 result.name = split[1];
621 } else {
622 result.name = fullName;
623 }
624
625 let stackEntry;
626 for (let i = this._namespaceStack.length - 1; i >= 0; i--) {
627 stackEntry = this._namespaceStack[i];
628
629 for (const key in stackEntry) {
630 if (!stackEntry.hasOwnProperty(key)) {
631 continue;
632 }
633
634 if (result.prefix === key) {
635 result.namespace = stackEntry[key];
636
637 return result;
638 }
639 }
640 }
641
642 return result;
643 }
644
645 private static _dereferenceEntities(s: string): string {
646 s = String(s);

Callers 1

constructorMethod · 0.80

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected