extractus / oembed-extractor

Extract oEmbed data from given webpage
https://extractor-demos.pages.dev/oembed-extractor
MIT License
104 stars 44 forks source link

fix typing errors #162

Closed xHomu closed 1 year ago

xHomu commented 1 year ago

Fix basic type errors for fetch api.

ndaidong commented 1 year ago

@xHomu thank you for your fix. I'm not familiar with TypeScript, just want to confirm a little bit about Record type at line 134 and 142. Where this type is defined? Or it's one of TS predefined types?

headers?: Record<string, string>;
xHomu commented 1 year ago

Record is a typescript utility type:

https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type

Record<string, string> generates a type that would accept only objects whose props that's string: string.

ndaidong commented 1 year ago

@xHomu ah thank you, I got it. Now I will merge your pr and resolve CI issue.