dohomi / storyblok-generate-ts

Generates TypeScript interface types based on Storyblok component file
MIT License
101 stars 32 forks source link

Fixes an error when filter_content_type is not an array. #29

Closed juanpasolano closed 1 year ago

juanpasolano commented 1 year ago

fixes #28 Took the liberty of creating a PR containing the patched code I had to add. I will leave it to your consideration if this can be merged. Let me know If you require anything to help move this forward.

produces the following type as an example:

export interface FeaturedProductsStoryblok {
  title?: string;
  products?: (StoryblokStory<ProductStoryblok> | string)[];
  _uid: string;
  component: "featured_products";
  [k: string]: any;
}

PD: there are probaly shorthands to write the code for this but I wanted to be verbose to be extra clear and readable

dohomi commented 1 year ago

strange I never encountered this. Will try to look into it on the weekend thanks for your contribution

diarm0d commented 1 year ago

Also encountered this issue today, thanks for PR @juanpasolano