@scalar/fastify-api-reference 1.28.4 → 1.28.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/fastify-api-reference
2
2
 
3
+ ## 1.28.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7a8965c]
8
+ - Updated dependencies [0f13162]
9
+ - Updated dependencies [49dffff]
10
+ - @scalar/types@0.1.2
11
+ - @scalar/core@0.2.2
12
+ - @scalar/openapi-parser@0.10.11
13
+
14
+ ## 1.28.5
15
+
3
16
  ## 1.28.4
4
17
 
5
18
  ## 1.28.3
@@ -1 +1 @@
1
- {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAwC7F;;GAEG;AACH,eAAO,MAAM,WAAW,s4EAwEvB,CAAA;AASD,QAAA,MAAM,mBAAmB,sIAkMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAwC7F;;GAEG;AACH,eAAO,MAAM,WAAW,s4EAwEvB,CAAA;AASD,QAAA,MAAM,mBAAmB,sIAwMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -121,20 +121,23 @@ const fastifyApiReference = fp(async (fastify, options) => {
121
121
  };
122
122
  const specSource = (() => {
123
123
  const { content, url } = configuration ?? {};
124
- if (content)
124
+ if (content) {
125
125
  return {
126
126
  type: 'content',
127
127
  get: () => {
128
- if (typeof content === 'function')
128
+ if (typeof content === 'function') {
129
129
  return content();
130
+ }
130
131
  return content;
131
132
  },
132
133
  };
133
- if (url)
134
+ }
135
+ if (url) {
134
136
  return {
135
137
  type: 'url',
136
138
  get: () => url,
137
139
  };
140
+ }
138
141
  if (fastify.hasPlugin('@fastify/swagger')) {
139
142
  return {
140
143
  type: 'swagger',
@@ -155,8 +158,9 @@ const fastifyApiReference = fp(async (fastify, options) => {
155
158
  if (options.hooks) {
156
159
  const additionalHooks = ['onRequest', 'preHandler'];
157
160
  for (const hook of additionalHooks) {
158
- if (options.hooks[hook])
161
+ if (options.hooks[hook]) {
159
162
  hooks[hook] = options.hooks[hook];
163
+ }
160
164
  }
161
165
  }
162
166
  const getLoadedSpecIfAvailable = () => {