diff --git a/helpers.ts b/helpers.ts new file mode 100644 index 0000000..12c90e5 --- /dev/null +++ b/helpers.ts @@ -0,0 +1 @@ +export type Nullable = { [K in keyof T]: T[K] | null }; diff --git a/type/json/LineItem.ts b/type/json/LineItem.ts index bbf662d..e2130f5 100644 --- a/type/json/LineItem.ts +++ b/type/json/LineItem.ts @@ -1,3 +1,5 @@ +import { Nullable } from '../../helpers'; + export default interface Item { id: number; properties: { [key: string]: any } | null; @@ -18,14 +20,14 @@ export default interface Item { final_price: number; final_line_price: number; url: string; - featured_image: { + featured_image: Nullable<{ aspect_ratio: number; alt: string; height: number; url: string; width: number; - }; - image: string; + }>; + image: string | null; handle: string; requires_shipping: boolean; product_type: string;