kjelsrud.dev/node_modules/mdast-util-phrasing/lib/index.js
2023-07-19 21:31:30 +02:00

31 lines
649 B
JavaScript

/**
* @typedef {import('mdast').PhrasingContent} PhrasingContent
* @typedef {import('unist-util-is').AssertPredicate<PhrasingContent>} AssertPredicatePhrasing
*/
import {convert} from 'unist-util-is'
/**
* Check if the given value is *phrasing content*.
*
* @param
* Thing to check, typically `Node`.
* @returns
* Whether `value` is phrasing content.
*/
export const phrasing = /** @type {AssertPredicatePhrasing} */ (
convert([
'break',
'delete',
'emphasis',
'footnote',
'footnoteReference',
'image',
'imageReference',
'inlineCode',
'link',
'linkReference',
'strong',
'text'
])
)