Skip to content

Commit

Permalink
Update type and add type check to keep the type linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jul 9, 2024
1 parent a975c27 commit d5cb57e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/editor/src/dataviews/actions/export-pattern.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function getJsonFromItem( item: Pattern ) {
{
__file: item.type,
title: getItemTitle( item ),
content: item.content?.raw || item.content,
content:
typeof item.content === 'string'
? item.content
: item.content?.raw,
syncStatus: item.wp_pattern_sync_status,
},
null,
Expand Down
4 changes: 1 addition & 3 deletions packages/editor/src/dataviews/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export interface TemplateOrTemplatePart extends BasePost {
export interface Pattern extends BasePost {
slug: string;
title: { raw: string };
content: {
raw: string;
};
content: { raw: string } | string;
wp_pattern_sync_status: string;
}

Expand Down

0 comments on commit d5cb57e

Please sign in to comment.