@hey-api/openapi-ts 0.85.2 → 0.86.1

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/README.md CHANGED
@@ -31,7 +31,7 @@
31
31
 
32
32
  ## Features
33
33
 
34
- - runs in CLI, Node.js 18+, or npx
34
+ - runs in CLI, Node.js 20+, or npx
35
35
  - works with OpenAPI 2.0, 3.0, and 3.1
36
36
  - core plugins for types, SDKs, and schemas
37
37
  - clients for your runtime (Fetch API, Angular, Axios, Next.js, Nuxt, etc.)
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let t={};for(var r in e)n(t,r,{get:e[r],enumerable:!0});return t},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=e(import.meta.url);export{u as i,c as n,d as r,s as t};
@@ -47,7 +47,9 @@ const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
47
47
  style = 'matrix';
48
48
  }
49
49
 
50
- const value = toValue(toValue(path)[name]);
50
+ const value = toValue(
51
+ (toValue(path) as Record<string, unknown> | undefined)?.[name],
52
+ );
51
53
 
52
54
  if (value === undefined || value === null) {
53
55
  continue;
@@ -157,7 +159,7 @@ const checkForExistence = (
157
159
  }
158
160
  if (
159
161
  options.headers.has(name) ||
160
- toValue(options.query)?.[name] ||
162
+ (toValue(options.query) as Record<string, unknown> | undefined)?.[name] ||
161
163
  options.headers.get('Cookie')?.includes(`${name}=`)
162
164
  ) {
163
165
  return true;
@@ -185,12 +187,18 @@ export const setAuthParams = async ({
185
187
  const name = auth.name ?? 'Authorization';
186
188
 
187
189
  switch (auth.in) {
188
- case 'query':
190
+ case 'query': {
189
191
  if (!options.query) {
190
192
  options.query = {};
191
193
  }
192
- toValue(options.query)[name] = token;
194
+ const queryValue = toValue(options.query) as
195
+ | Record<string, unknown>
196
+ | undefined;
197
+ if (queryValue) {
198
+ queryValue[name] = token;
199
+ }
193
200
  break;
201
+ }
194
202
  case 'cookie':
195
203
  options.headers.append('Cookie', `${name}=${token}`);
196
204
  break;