@kubb/adapter-oas 5.5.4 → 5.5.5

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/index.cjs CHANGED
@@ -452,7 +452,7 @@ async function resolveSource(sourcePath) {
452
452
  * its parse error instead.
453
453
  */
454
454
  async function assertInputExists(input) {
455
- if (URL.canParse(input)) return;
455
+ if (urlRegExp.test(input)) return;
456
456
  if (!await exists(input)) throw new _kubb_core.Diagnostics.Error({
457
457
  code: _kubb_core.Diagnostics.code.inputNotFound,
458
458
  severity: "error",
@@ -541,7 +541,7 @@ async function parseDocument(pathOrApi) {
541
541
  */
542
542
  async function parseFromConfig(source) {
543
543
  if (source.type === "data") return parseDocument(typeof source.data === "string" ? (0, yaml.parse)(source.data) : structuredClone(source.data));
544
- if (URL.canParse(source.path)) return parseDocument(source.path);
544
+ if (urlRegExp.test(source.path)) return parseDocument(source.path);
545
545
  const resolved = node_path.default.resolve(node_path.default.dirname(source.path), source.path);
546
546
  await assertInputExists(resolved);
547
547
  return parseDocument(resolved);
@@ -2016,7 +2016,7 @@ function walkPointer(document, $ref) {
2016
2016
  applicable: false,
2017
2017
  value: null
2018
2018
  };
2019
- const pointer = globalThis.decodeURIComponent(trimmed.substring(1));
2019
+ const pointer = trimmed.substring(1);
2020
2020
  let docCache = _refCache.get(document);
2021
2021
  if (!docCache) {
2022
2022
  docCache = /* @__PURE__ */ new Map();
@@ -2026,7 +2026,7 @@ function walkPointer(document, $ref) {
2026
2026
  applicable: true,
2027
2027
  value: docCache.get(pointer)
2028
2028
  };
2029
- const current = pointer.split("/").filter(Boolean).reduce((obj, key) => obj?.[key], document);
2029
+ const current = pointer.split("/").filter(Boolean).map((token) => globalThis.decodeURIComponent(token).replaceAll("~1", "/").replaceAll("~0", "~")).reduce((obj, key) => obj?.[key], document);
2030
2030
  if (current) docCache.set(pointer, current);
2031
2031
  return {
2032
2032
  applicable: true,