INNER CODE UNIT · TypeScript

stripHtml

ahmet/awesome-web3 · lib/catalog.ts:101

function stripHtml(value: string) {
  return value
    .replace(/<[^>]+>/g, ' ')
    .replace(/\s+/g, ' ')
    .trim()
}

export type CatalogProps = {
  title: string
  description: string
  categories: Category[]
  resources: Array<[string, string, string, string, string, string | null]>
}

export function toCatalogProps(catalog: Catalog): CatalogProps {
  return {
    title: catalog.title,
    description: catalog.description,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…