( text: string, webappHost = getWebappHost(), )
| 81 | }; |
| 82 | |
| 83 | export const findPostIdInText = ( |
| 84 | text: string, |
| 85 | webappHost = getWebappHost(), |
| 86 | ): string | undefined => |
| 87 | splitLinks(text).reduce<string | undefined>( |
| 88 | (found, segment) => |
| 89 | found ?? |
| 90 | (segment.type === 'link' |
| 91 | ? getPostIdFromUrl(segment.url, webappHost) |
| 92 | : undefined), |
| 93 | undefined, |
| 94 | ); |
no test coverage detected