jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
908 stars 50 forks source link

fix: improper use of null when interface asks for undefined #71

Closed FineWolf closed 11 months ago

FineWolf commented 1 year ago

SEO.props define several properties as being optional with ?. This extends their accepted types with undefined.

However, in multiple places in the code base, an improper check is made that expects the value to be null.

In JavaScript and TypeScript, null and undefined are two completely different values.

This ensures that no matter the value, checks are appropriately made. This was particularly apparent with the generation of invalid og:image:alt and og:image:height tags if no values were passed to the component.

jonasmerlin commented 11 months ago

@FineWolf Sorry for the long delay! Thanks for your contribution. Will land in the next version of astro-seo (to be released today)