@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.
@@ -14864,11 +14864,50 @@ class STSFhirValidator {
14864
14864
  }
14865
14865
  */
14866
14866
  }
14867
+ function normalizeUri(uri2) {
14868
+ try {
14869
+ const u = new URL(uri2);
14870
+ u.search = "";
14871
+ u.hash = "";
14872
+ return u.toString().replace(/\/+$/, "");
14873
+ } catch (err) {
14874
+ throw new Error(`Invalid URI: ${uri2}`);
14875
+ }
14876
+ }
14877
+ function isAbsoluteUrl(val) {
14878
+ try {
14879
+ new URL(val);
14880
+ return true;
14881
+ } catch {
14882
+ return false;
14883
+ }
14884
+ }
14885
+ function getBaseResource(url2) {
14886
+ const segments = url2.pathname.split("/").filter(Boolean);
14887
+ const basePath = segments.slice(0, -1).join("/");
14888
+ return url2.origin + "/" + (basePath ? basePath + "/" : "");
14889
+ }
14890
+ function GetAboveHierarchy(uri2) {
14891
+ const url2 = new URL(uri2);
14892
+ url2.search = "";
14893
+ url2.hash = "";
14894
+ const base = `${url2.protocol}//${url2.host}`;
14895
+ const pathParts = url2.pathname.split("/").filter(Boolean);
14896
+ const hierarchy = [base];
14897
+ for (let i = 0; i < pathParts.length; i++) {
14898
+ hierarchy.push(`${base}/${pathParts.slice(0, i + 1).join("/")}`);
14899
+ }
14900
+ return hierarchy.reverse().map((u) => u.replace(/\/+$/, ""));
14901
+ }
14867
14902
  export {
14868
14903
  FhirClient,
14904
+ GetAboveHierarchy,
14869
14905
  STSFhirValidator,
14870
14906
  fhirRT,
14871
14907
  fhirSP,
14872
- fhirSPRefOnly
14908
+ fhirSPRefOnly,
14909
+ getBaseResource,
14910
+ isAbsoluteUrl,
14911
+ normalizeUri
14873
14912
  };
14874
14913
  //# sourceMappingURL=stsfhirclient.mjs.map