UNPKG

@botonic/plugin-contentful

Version:

Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet

18 lines (16 loc) 531 B
import { Markdown } from './markdown' import { MarkUp, MarkupType } from './markup' import { WhatsApp } from './whatsapp' export function createMarkUp(type: MarkupType): MarkUp { switch (type) { case MarkupType.MARKDOWN: case MarkupType.GITHUB: case MarkupType.CONTENTFUL: return new Markdown(type) case MarkupType.WHATSAPP: return new WhatsApp() default: // eslint-disable-next-line @typescript-eslint/restrict-template-expressions throw Error(`Invalid markdup type: ${type}`) } }