fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #852 from hey-api/fix/excel-doc-type

fix: process application types except for application/json as blobs

authored by

Lubos and committed by
GitHub
572fce1e d85a8d9c

+17 -27
+5
.changeset/mean-houses-explode.md
··· 1 + --- 2 + '@hey-api/client-fetch': patch 3 + --- 4 + 5 + fix: process application types except for application/json as blobs
+4 -9
packages/client-fetch/src/utils.ts
··· 337 337 } 338 338 339 339 if ( 340 - [ 341 - 'application/octet-stream', 342 - 'application/pdf', 343 - 'application/zip', 344 - 'audio/', 345 - 'image/', 346 - 'video/', 347 - ].some((type) => content.includes(type)) 340 + ['application/', 'audio/', 'image/', 'video/'].some((type) => 341 + content.startsWith(type), 342 + ) 348 343 ) { 349 344 return 'blob'; 350 345 } 351 346 352 - if (content.includes('text/')) { 347 + if (content.startsWith('text/')) { 353 348 return 'text'; 354 349 } 355 350 };
+4 -9
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle/core/utils.ts.snap
··· 337 337 } 338 338 339 339 if ( 340 - [ 341 - 'application/octet-stream', 342 - 'application/pdf', 343 - 'application/zip', 344 - 'audio/', 345 - 'image/', 346 - 'video/', 347 - ].some((type) => content.includes(type)) 340 + ['application/', 'audio/', 'image/', 'video/'].some((type) => 341 + content.startsWith(type), 342 + ) 348 343 ) { 349 344 return 'blob'; 350 345 } 351 346 352 - if (content.includes('text/')) { 347 + if (content.startsWith('text/')) { 353 348 return 'text'; 354 349 } 355 350 };
+4 -9
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle_transform/core/utils.ts.snap
··· 337 337 } 338 338 339 339 if ( 340 - [ 341 - 'application/octet-stream', 342 - 'application/pdf', 343 - 'application/zip', 344 - 'audio/', 345 - 'image/', 346 - 'video/', 347 - ].some((type) => content.includes(type)) 340 + ['application/', 'audio/', 'image/', 'video/'].some((type) => 341 + content.startsWith(type), 342 + ) 348 343 ) { 349 344 return 'blob'; 350 345 } 351 346 352 - if (content.includes('text/')) { 347 + if (content.startsWith('text/')) { 353 348 return 'text'; 354 349 } 355 350 };