INNER CODE UNIT · TypeScript
idx
ahmet/awesome-web3 · lib/catalog.ts:94
const idx = nodes.findIndex((node) => node.type === 'link')
if (idx === -1) return ''
return textOf({ type: 'paragraph', children: nodes.slice(idx + 1) })
.replace(/^\s*[-–—:]\s*/, '')
.trim()
}
function stripHtml(value: string) {
return value
.replace(/<[^>]+>/g, ' ')
.replace(/\s+/g, ' ')
.trim()
}
export type CatalogProps = {
title: string
description: string
categories: Category[]