@nsshunt/stsfhirclient 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14866,11 +14866,50 @@
14866
14866
  }
14867
14867
  */
14868
14868
  }
14869
+ function normalizeUri(uri2) {
14870
+ try {
14871
+ const u = new URL(uri2);
14872
+ u.search = "";
14873
+ u.hash = "";
14874
+ return u.toString().replace(/\/+$/, "");
14875
+ } catch (err) {
14876
+ throw new Error(`Invalid URI: ${uri2}`);
14877
+ }
14878
+ }
14879
+ function isAbsoluteUrl(val) {
14880
+ try {
14881
+ new URL(val);
14882
+ return true;
14883
+ } catch {
14884
+ return false;
14885
+ }
14886
+ }
14887
+ function getBaseResource(url2) {
14888
+ const segments = url2.pathname.split("/").filter(Boolean);
14889
+ const basePath = segments.slice(0, -1).join("/");
14890
+ return url2.origin + "/" + (basePath ? basePath + "/" : "");
14891
+ }
14892
+ function GetAboveHierarchy(uri2) {
14893
+ const url2 = new URL(uri2);
14894
+ url2.search = "";
14895
+ url2.hash = "";
14896
+ const base = `${url2.protocol}//${url2.host}`;
14897
+ const pathParts = url2.pathname.split("/").filter(Boolean);
14898
+ const hierarchy = [base];
14899
+ for (let i = 0; i < pathParts.length; i++) {
14900
+ hierarchy.push(`${base}/${pathParts.slice(0, i + 1).join("/")}`);
14901
+ }
14902
+ return hierarchy.reverse().map((u) => u.replace(/\/+$/, ""));
14903
+ }
14869
14904
  exports2.FhirClient = FhirClient;
14905
+ exports2.GetAboveHierarchy = GetAboveHierarchy;
14870
14906
  exports2.STSFhirValidator = STSFhirValidator;
14871
14907
  exports2.fhirRT = fhirRT;
14872
14908
  exports2.fhirSP = fhirSP;
14873
14909
  exports2.fhirSPRefOnly = fhirSPRefOnly;
14910
+ exports2.getBaseResource = getBaseResource;
14911
+ exports2.isAbsoluteUrl = isAbsoluteUrl;
14912
+ exports2.normalizeUri = normalizeUri;
14874
14913
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
14875
14914
  }));
14876
14915
  //# sourceMappingURL=stsfhirclient.umd.js.map