Browse Source

Merge pull request #7859 from weseek/imprv/type-guard

imprv: Add type guard
Ryoji Shimizu 2 years ago
parent
commit
007f848343
1 changed files with 1 additions and 1 deletions
  1. 1 1
      apps/app/src/services/renderer/remark-plugins/attachment.ts

+ 1 - 1
apps/app/src/services/renderer/remark-plugins/attachment.ts

@@ -7,7 +7,7 @@ import { visit } from 'unist-util-visit';
 
 
 const SUPPORTED_ATTRIBUTES = ['attachmentId', 'url', 'attachmentName'];
 const SUPPORTED_ATTRIBUTES = ['attachmentId', 'url', 'attachmentName'];
 
 
-const isAttachmentLink = (url: string) => {
+const isAttachmentLink = (url: string): boolean => {
   // https://regex101.com/r/9qZhiK/1
   // https://regex101.com/r/9qZhiK/1
   const attachmentUrlFormat = new RegExp(/^\/(attachment)\/([^/^\n]+)$/);
   const attachmentUrlFormat = new RegExp(/^\/(attachment)\/([^/^\n]+)$/);
   return attachmentUrlFormat.test(url);
   return attachmentUrlFormat.test(url);