Skip to content

Commit 47885a2

Browse files
committed
fix: Work around typing issue (sillsdev#65)
1 parent 2c5a365 commit 47885a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plugins/VideoTransformer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ export const standardVideoTransformer: IPlugin = {
2222
url = video.file.url;
2323
break;
2424
default:
25+
// video.type can only be "external" or "file" as of the writing of this code, so typescript
26+
// isn't happy trying to turn video.type into a string. But this default in our switch is
27+
// just attempting some future-proofing. Thus the strange typing/stringifying below.
2528
warning(
26-
`[standardVideoTransformer] Found Notion "video" block with type ${video.type}. The best docu-notion can do for now is ignore it.`
29+
`[standardVideoTransformer] Found Notion "video" block with type ${JSON.stringify(
30+
(video as any).type
31+
)}. The best docu-notion can do for now is ignore it.`
2732
);
2833
return "";
2934
break;

0 commit comments

Comments
 (0)