Skip to content

Commit

Permalink
fix: type cast empty array to fix a typescript error (#382)
Browse files Browse the repository at this point in the history
* fix: type cast empty array to fix a typescript error

* style: run prettier
  • Loading branch information
wolfy1339 authored Jan 23, 2023
1 parent c2dc837 commit 90b6705
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function parse(options: EndpointDefaults): RequestOptions {

if (options.mediaType.previews.length) {
const previewsFromAcceptHeader =
headers.accept.match(/[\w-]+(?=-preview)/g) || [];
headers.accept.match(/[\w-]+(?=-preview)/g) || ([] as string[]);
headers.accept = previewsFromAcceptHeader
.concat(options.mediaType.previews)
.map((preview) => {
Expand Down

0 comments on commit 90b6705

Please sign in to comment.