UNPKG

@r4ai/remark-embed

Version:

[![JSR](https://jsr.io/badges/@r4ai/remark-embed)](https://jsr.io/@r4ai/remark-embed) [![codecov](https://codecov.io/gh/r4ai/remark-embed/graph/badge.svg?token=B9EZXC0PR8)](https://codecov.io/gh/r4ai/remark-embed) [![CI](https://github.com/r4ai/remark-emb

14 lines (13 loc) 330 B
/** * Utility to create hast elements. */ export const h = (tagName, properties, ...children) => ({ type: "element", tagName, properties, children: children .filter((child) => child != null) .map((child) => typeof child === "string" ? { type: "text", value: child } : child), });