@stainless-api/docs-ui 0.1.0-beta.22 → 0.1.0-beta.23

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.
package/dist/routing.js CHANGED
@@ -42,9 +42,9 @@ var DefaultLanguage = "http";
42
42
  var StainlessPathPattern = /(\(resource\) (?<resource>[^\s]+))( > (\(method\) (?<method>[^\s]+)|\(model\) (?<model>[^\s]+))?)?/;
43
43
  function parseStainlessPath(stainlessPath) {
44
44
  const match = stainlessPath.match(StainlessPathPattern);
45
- if (!match?.groups) return null;
45
+ if (!match) return null;
46
46
  return {
47
- resource: match.groups.resource?.split(".") ?? null,
47
+ resource: match.groups.resource.split("."),
48
48
  method: match.groups.method ?? null,
49
49
  model: match.groups.model ?? null,
50
50
  routable: match.groups.model ? match[1] : match[0]
@@ -55,7 +55,7 @@ function trimStainlessPath(stainlessPath) {
55
55
  }
56
56
  function getResource(stainlessPath) {
57
57
  const parsed = parseStainlessPath(stainlessPath);
58
- return parsed?.resource?.[0];
58
+ return parsed?.resource[0];
59
59
  }
60
60
  function parseRoute(basePath, route) {
61
61
  if (!route.startsWith(basePath)) return { stainlessPath: "", language: DefaultLanguage };
@@ -145,7 +145,7 @@ function findNavigationPath(items, target) {
145
145
  }
146
146
  function expandToElement(el) {
147
147
  while (el) {
148
- if (el instanceof HTMLDetailsElement) el.open = true;
148
+ if (el.tagName === "DETAILS") el["open"] = true;
149
149
  el = el.parentElement;
150
150
  }
151
151
  }