mdast-util-to-string
Advanced tools
Comparing version 3.2.0 to 4.0.0
@@ -7,3 +7,3 @@ /** | ||
* | ||
* @param {unknown} value | ||
* @param {unknown} [value] | ||
* Thing to serialize, typically `Node`. | ||
@@ -16,6 +16,6 @@ * @param {Options | null | undefined} [options] | ||
export function toString( | ||
value: unknown, | ||
value?: unknown, | ||
options?: Options | null | undefined | ||
): string | ||
export type Node = import('mdast').Root | import('mdast').Content | ||
export type Nodes = import('mdast').Nodes | ||
/** | ||
@@ -26,9 +26,9 @@ * Configuration (optional). | ||
/** | ||
* Whether to use `alt` for `image`s. | ||
* Whether to use `alt` for `image`s (default: `true`). | ||
*/ | ||
includeImageAlt?: boolean | null | undefined | ||
/** | ||
* Whether to use `value` of HTML. | ||
* Whether to use `value` of HTML (default: `true`). | ||
*/ | ||
includeHtml?: boolean | null | undefined | ||
} |
/** | ||
* @typedef {import('mdast').Root|import('mdast').Content} Node | ||
* @typedef {import('mdast').Nodes} Nodes | ||
* | ||
@@ -7,5 +7,5 @@ * @typedef Options | ||
* @property {boolean | null | undefined} [includeImageAlt=true] | ||
* Whether to use `alt` for `image`s. | ||
* Whether to use `alt` for `image`s (default: `true`). | ||
* @property {boolean | null | undefined} [includeHtml=true] | ||
* Whether to use `value` of HTML. | ||
* Whether to use `value` of HTML (default: `true`). | ||
*/ | ||
@@ -22,3 +22,3 @@ | ||
* | ||
* @param {unknown} value | ||
* @param {unknown} [value] | ||
* Thing to serialize, typically `Node`. | ||
@@ -105,3 +105,3 @@ * @param {Options | null | undefined} [options] | ||
* Thing. | ||
* @returns {value is Node} | ||
* @returns {value is Nodes} | ||
* Whether `value` is a node. | ||
@@ -108,0 +108,0 @@ */ |
{ | ||
"name": "mdast-util-to-string", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "mdast utility to get the plain text content of a node", | ||
@@ -29,4 +29,3 @@ "license": "MIT", | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"exports": "./index.js", | ||
"files": [ | ||
@@ -38,14 +37,13 @@ "lib/", | ||
"dependencies": { | ||
"@types/mdast": "^3.0.0" | ||
"@types/mdast": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.0.0", | ||
"c8": "^7.0.0", | ||
"@types/node": "^20.0.0", | ||
"c8": "^8.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"tape": "^5.0.0", | ||
"type-coverage": "^2.0.0", | ||
"typescript": "^5.0.0", | ||
"xo": "^0.53.0" | ||
"xo": "^0.54.0" | ||
}, | ||
@@ -57,19 +55,16 @@ "scripts": { | ||
"test-api": "node --conditions development test.js", | ||
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api", | ||
"test-coverage": "c8 --100 --reporter lcov npm run test-api", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "none", | ||
"useTabs": false | ||
}, | ||
"xo": { | ||
"prettier": true | ||
}, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-wooorm" | ||
"remark-preset-wooorm" | ||
] | ||
@@ -80,4 +75,8 @@ }, | ||
"detail": true, | ||
"ignoreCatch": true, | ||
"strict": true | ||
}, | ||
"xo": { | ||
"prettier": true | ||
} | ||
} |
@@ -47,3 +47,3 @@ # mdast-util-to-string | ||
This package is [ESM only][esm]. | ||
In Node.js (version 14.14+ and 16.0+), install with [npm][]: | ||
In Node.js (version 16+), install with [npm][]: | ||
@@ -57,3 +57,3 @@ ```sh | ||
```js | ||
import {toString} from 'https://esm.sh/mdast-util-to-string@3' | ||
import {toString} from 'https://esm.sh/mdast-util-to-string@4' | ||
``` | ||
@@ -65,3 +65,3 @@ | ||
<script type="module"> | ||
import {toString} from 'https://esm.sh/mdast-util-to-string@3?bundle' | ||
import {toString} from 'https://esm.sh/mdast-util-to-string@4?bundle' | ||
</script> | ||
@@ -73,3 +73,2 @@ ``` | ||
```js | ||
import {unified} from 'unified' | ||
import {fromMarkdown} from 'mdast-util-from-markdown' | ||
@@ -85,3 +84,3 @@ import {toString} from 'mdast-util-to-string' | ||
This package exports the identifier [`toString`][api-tostring]. | ||
This package exports the identifier [`toString`][api-to-string]. | ||
There is no default export. | ||
@@ -125,7 +124,10 @@ | ||
Projects maintained by the unified collective are compatible with all maintained | ||
Projects maintained by the unified collective are compatible with maintained | ||
versions of Node.js. | ||
As of now, that is Node.js 14.14+ and 16.0+. | ||
Our projects sometimes work with older versions, but this is not guaranteed. | ||
When we cut a new major release, we drop support for unmaintained versions of | ||
Node. | ||
This means we try to keep the current release line, `mdast-util-to-string@^4`, | ||
compatible with Node.js 16. | ||
## Security | ||
@@ -172,5 +174,5 @@ | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-to-string.svg | ||
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-string | ||
[size]: https://bundlephobia.com/result?p=mdast-util-to-string | ||
[size]: https://bundlejs.com/?q=mdast-util-to-string | ||
@@ -221,4 +223,4 @@ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[api-tostring]: #tostringvalue-options | ||
[api-to-string]: #tostringvalue-options | ||
[api-options]: #options |
12692
8
219
+ Added@types/mdast@4.0.4(transitive)
+ Added@types/unist@3.0.2(transitive)
- Removed@types/mdast@3.0.15(transitive)
- Removed@types/unist@2.0.10(transitive)
Updated@types/mdast@^4.0.0