@scalar/fastify-api-reference 1.25.115 → 1.25.118

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.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { default } from './fastifyApiReference';
2
- export * from './types';
1
+ export { default } from './fastifyApiReference.ts';
2
+ export * from './types.ts';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -18524,7 +18524,7 @@ function resolveUri(uri2, options, file, filesystem, resolve2, errors2) {
18524
18524
  code: "INVALID_REFERENCE",
18525
18525
  message: ERRORS.INVALID_REFERENCE.replace("%s", uri2)
18526
18526
  });
18527
- return;
18527
+ return void 0;
18528
18528
  }
18529
18529
  const [prefix, path2] = uri2.split("#", 2);
18530
18530
  const isDifferentFile = prefix !== file.filename;
@@ -18540,7 +18540,7 @@ function resolveUri(uri2, options, file, filesystem, resolve2, errors2) {
18540
18540
  code: "EXTERNAL_REFERENCE_NOT_FOUND",
18541
18541
  message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s", prefix)
18542
18542
  });
18543
- return;
18543
+ return void 0;
18544
18544
  }
18545
18545
  if (path2 === void 0) {
18546
18546
  return externalReference.specification;
@@ -18561,6 +18561,7 @@ function resolveUri(uri2, options, file, filesystem, resolve2, errors2) {
18561
18561
  message: ERRORS.INVALID_REFERENCE.replace("%s", uri2)
18562
18562
  });
18563
18563
  }
18564
+ return void 0;
18564
18565
  }
18565
18566
  const eq = (x) => (y) => x === y;
18566
18567
  const not = (fn) => (x) => !fn(x);
@@ -18570,7 +18571,7 @@ const isXError = (x) => (error2) => error2.keyword === x;
18570
18571
  const isRequiredError = isXError("required");
18571
18572
  const isAnyOfError = isXError("anyOf");
18572
18573
  const isEnumError = isXError("enum");
18573
- const getErrors = (node) => node && node.errors || [];
18574
+ const getErrors = (node) => (node == null ? void 0 : node.errors) || [];
18574
18575
  const getChildren = (node) => node && getValues(node.children) || [];
18575
18576
  const getSiblings = (parent) => (node) => getChildren(parent).filter(not(eq(node)));
18576
18577
  const concatAll = (
@@ -19150,7 +19151,7 @@ function upgradeFromThreeToThreeOne(originalSpecification) {
19150
19151
  }
19151
19152
  specification = traverse(specification, (schema2) => {
19152
19153
  if (schema2.type !== "undefined" && schema2.nullable === true) {
19153
- schema2.type = ["null", schema2.type];
19154
+ schema2.type = [schema2.type, "null"];
19154
19155
  delete schema2.nullable;
19155
19156
  }
19156
19157
  return schema2;
@@ -19626,6 +19627,7 @@ const fetchUrls = (customConfiguration) => {
19626
19627
  return await response.text();
19627
19628
  } catch (error2) {
19628
19629
  console.error("[fetchUrls]", error2.message, `(${value})`);
19630
+ return void 0;
19629
19631
  }
19630
19632
  }
19631
19633
  };
@@ -19793,9 +19795,8 @@ const fastifyApiReference = fp(
19793
19795
  if (fastify.hasPlugin("@fastify/swagger")) {
19794
19796
  return {
19795
19797
  type: "swagger",
19796
- get: () => {
19797
- return fastify.swagger();
19798
- }
19798
+ // @ts-ignore We know that @fastify/swagger is loaded.
19799
+ get: () => fastify.swagger()
19799
19800
  };
19800
19801
  }
19801
19802
  return void 0;
@@ -19814,7 +19815,7 @@ const fastifyApiReference = fp(
19814
19815
  "preHandler"
19815
19816
  ];
19816
19817
  for (const hook of additionalHooks) {
19817
- hooks[hook] = options.hooks[hook];
19818
+ if (options.hooks[hook]) hooks[hook] = options.hooks[hook];
19818
19819
  }
19819
19820
  }
19820
19821
  const getLoadedSpecIfAvailable = () => {