basant307/AI_Governance_Project
045
1# mdast-util-phrasing2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][size-badge]][size]7[![Sponsors][sponsors-badge]][collective]8[![Backers][backers-badge]][collective]9[![Chat][chat-badge]][chat]10 11[mdast][] utility to check if a node is phrasing content.12 13## Contents14 15* [What is this?](#what-is-this)16* [When should I use this?](#when-should-i-use-this)17* [Install](#install)18* [Use](#use)19* [API](#api)20 * [`phrasing(value)`](#phrasingvalue)21* [Types](#types)22* [Compatibility](#compatibility)23* [Security](#security)24* [Related](#related)25* [Contribute](#contribute)26* [License](#license)27 28## What is this?29 30This package is a tiny utility to check that a given [node][] is [phrasing31content][phrasing].32 33## When should I use this?34 35This utility is typically useful if you’re making other utilities.36It uses [`unist-util-is`][unist-util-is], which you can use for your own checks.37 38A different utility, [`hast-util-phrasing`][hast-util-phrasing], does the same39but on [hast][].40 41## Install42 43This package is [ESM only][esm].44In Node.js (version 16+), install with [npm][]:45 46```sh47npm install mdast-util-phrasing48```49 50In Deno with [`esm.sh`][esmsh]:51 52```js53import {phrasing} from 'https://esm.sh/mdast-util-phrasing@4'54```55 56In browsers with [`esm.sh`][esmsh]:57 58```html59<script type="module">60 import {phrasing} from 'https://esm.sh/mdast-util-phrasing@4?bundle'61</script>62```63 64## Use65 66```js67import {phrasing} from 'mdast-util-phrasing'68 69phrasing({type: 'paragraph', children: [{type: 'text', value: 'Alpha'}]})70// => false71 72phrasing({type: 'strong', children: [{type: 'text', value: 'Delta'}]})73// => true74```75 76## API77 78This package exports the identifier [`phrasing`][api-phrasing].79There is no default export.80 81### `phrasing(value)`82 83Check if the given value is *[phrasing content][phrasing]*.84 85> 👉 **Note**: Excludes `html`, which can be both phrasing or flow.86 87###### Parameters88 89* `value` (`unknown`)90 — thing to check, typically [`Node`][node]91 92###### Returns93 94Whether `value` is phrasing content (`boolean`).95 96## Types97 98This package is fully typed with [TypeScript][].99It does not export extra types.100 101## Compatibility102 103Projects maintained by the unified collective are compatible with maintained104versions of Node.js.105 106When we cut a new major release, we drop support for unmaintained versions of107Node.108This means we try to keep the current release line, `mdast-util-phrasing@^4`,109compatible with Node.js 16.110 111## Security112 113Use of `mdast-util-phrasing` does not involve **[hast][]**, user content, or114change the tree, so there are no openings for [cross-site scripting (XSS)][xss]115attacks.116 117## Related118 119* [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing)120 — check if a hast node is phrasing content121* [`unist-util-is`](https://github.com/syntax-tree/unist-util-is)122 — check if a node passes a test123 124## Contribute125 126See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for127ways to get started.128See [`support.md`][support] for ways to get help.129 130This project has a [code of conduct][coc].131By interacting with this repository, organization, or community you agree to132abide by its terms.133 134## License135 136[MIT][license] © [Victor Felder][author]137 138<!-- Definitions -->139 140[build-badge]: https://github.com/syntax-tree/mdast-util-phrasing/workflows/main/badge.svg141 142[build]: https://github.com/syntax-tree/mdast-util-phrasing/actions143 144[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-phrasing.svg145 146[coverage]: https://codecov.io/github/syntax-tree/mdast-util-phrasing147 148[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-phrasing.svg149 150[downloads]: https://www.npmjs.com/package/mdast-util-phrasing151 152[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-phrasing153 154[size]: https://bundlejs.com/?q=mdast-util-phrasing155 156[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg157 158[backers-badge]: https://opencollective.com/unified/backers/badge.svg159 160[collective]: https://opencollective.com/unified161 162[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg163 164[chat]: https://github.com/syntax-tree/unist/discussions165 166[npm]: https://docs.npmjs.com/cli/install167 168[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c169 170[esmsh]: https://esm.sh171 172[typescript]: https://www.typescriptlang.org173 174[license]: license175 176[author]: https://draft.li177 178[health]: https://github.com/syntax-tree/.github179 180[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md181 182[support]: https://github.com/syntax-tree/.github/blob/main/support.md183 184[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md185 186[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting187 188[hast]: https://github.com/syntax-tree/hast189 190[mdast]: https://github.com/syntax-tree/mdast191 192[node]: https://github.com/syntax-tree/mdast#nodes193 194[phrasing]: https://github.com/syntax-tree/mdast#phrasingcontent195 196[unist-util-is]: https://github.com/syntax-tree/unist-util-is197 198[hast-util-phrasing]: https://github.com/syntax-tree/hast-util-phrasing199 200[api-phrasing]: #phrasingvalue201 