4cd4fd28
郭伟龙
feat: 初始化项目
|
1
2
3
4
5
6
7
8
|
import { RX_HTML_TAGS } from '../constants/regex'
// Removes anything that looks like an HTML tag from the supplied string
export const stripTags = (text = '') => String(text).replace(RX_HTML_TAGS, '')
// Generate a `domProps` object for either `innerHTML`, `textContent` or an empty object
export const htmlOrText = (innerHTML, textContent) =>
innerHTML ? { innerHTML } : textContent ? { textContent } : {}
|