Skip to content

Commit 29ba27f

Browse files
committed
Update dev-dependencies
1 parent 52b3d5a commit 29ba27f

File tree

5 files changed

+94
-93
lines changed

5 files changed

+94
-93
lines changed

Diff for: lib/handlers/iframe.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
*/
2020
export function iframe(state, node) {
2121
const properties = node.properties || {}
22-
const src = String(properties.src || '')
22+
const source = String(properties.src || '')
2323
const title = String(properties.title || '')
2424

2525
// Only create a link if there is a title.
2626
// We can’t use the content of the frame because conforming HTML parsers treat
2727
// it as text, whereas legacy parsers treat it as HTML, so it will likely
2828
// contain tags that will show up in text.
29-
if (src && title) {
29+
if (source && title) {
3030
/** @type {Link} */
3131
const result = {
3232
type: 'link',
3333
title: null,
34-
url: state.resolve(src),
34+
url: state.resolve(source),
3535
children: [{type: 'text', value: title}]
3636
}
3737
state.patch(node, result)

Diff for: lib/handlers/media.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {wrapNeeded} from '../util/wrap.js'
2525
export function media(state, node) {
2626
const properties = node.properties || {}
2727
const poster = node.tagName === 'video' ? String(properties.poster || '') : ''
28-
let src = String(properties.src || '')
28+
let source = String(properties.src || '')
2929
let index = -1
3030
let linkInFallbackContent = false
3131
let nodes = state.all(node)
@@ -46,15 +46,15 @@ export function media(state, node) {
4646
}
4747

4848
// Find the source.
49-
while (!src && ++index < node.children.length) {
49+
while (!source && ++index < node.children.length) {
5050
const child = node.children[index]
5151

5252
if (
5353
child.type === 'element' &&
5454
child.tagName === 'source' &&
5555
child.properties
5656
) {
57-
src = String(child.properties.src || '')
57+
source = String(child.properties.src || '')
5858
}
5959
}
6060

@@ -80,7 +80,7 @@ export function media(state, node) {
8080
const result = {
8181
type: 'link',
8282
title: properties.title ? String(properties.title) : null,
83-
url: state.resolve(src),
83+
url: state.resolve(source),
8484
children
8585
}
8686
state.patch(node, result)

Diff for: lib/util/find-selected-options.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ import {toText} from 'hast-util-to-text'
2121
/**
2222
* @param {Readonly<Element>} node
2323
* hast element to inspect.
24-
* @param {Properties | undefined} [properties]
24+
* @param {Properties | undefined} [explicitProperties]
2525
* Properties to use, normally taken from `node`, but can be changed.
2626
* @returns {Options}
2727
* Options.
2828
*/
29-
export function findSelectedOptions(node, properties) {
29+
export function findSelectedOptions(node, explicitProperties) {
3030
/** @type {Array<Element>} */
3131
const selectedOptions = []
3232
/** @type {Options} */
3333
const values = []
34-
const props = properties || node.properties || {}
34+
const properties = explicitProperties || node.properties || {}
3535
const options = findOptions(node)
3636
const size =
37-
Math.min(Number.parseInt(String(props.size), 10), 0) ||
38-
(props.multiple ? 4 : 1)
37+
Math.min(Number.parseInt(String(properties.size), 10), 0) ||
38+
(properties.multiple ? 4 : 1)
3939
let index = -1
4040

4141
while (++index < options.length) {
@@ -52,10 +52,10 @@ export function findSelectedOptions(node, properties) {
5252

5353
while (++index < max) {
5454
const option = list[index]
55-
const props = option.properties || {}
55+
const properties = option.properties || {}
5656
const content = toText(option)
57-
const label = content || String(props.label || '')
58-
const value = String(props.value || '') || content
57+
const label = content || String(properties.label || '')
58+
const value = String(properties.value || '') || content
5959
values.push([value, label === value ? undefined : label])
6060
}
6161

Diff for: package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"unist-util-visit": "^5.0.0"
5252
},
5353
"devDependencies": {
54-
"@types/node": "^20.0.0",
55-
"@types/ungap__structured-clone": "^0.3.0",
56-
"c8": "^8.0.0",
54+
"@types/node": "^22.0.0",
55+
"@types/ungap__structured-clone": "^1.0.0",
56+
"c8": "^10.0.0",
5757
"hast-util-from-html": "^2.0.0",
5858
"hastscript": "^8.0.0",
5959
"is-hidden": "^2.0.0",
@@ -63,13 +63,13 @@
6363
"mdast-util-to-markdown": "^2.0.0",
6464
"micromark-extension-gfm": "^3.0.0",
6565
"prettier": "^3.0.0",
66-
"remark-cli": "^11.0.0",
67-
"remark-preset-wooorm": "^9.0.0",
66+
"remark-cli": "^12.0.0",
67+
"remark-preset-wooorm": "^10.0.0",
6868
"type-coverage": "^2.0.0",
6969
"typescript": "^5.0.0",
7070
"unist-builder": "^4.0.0",
7171
"unist-util-remove-position": "^5.0.0",
72-
"xo": "^0.56.0"
72+
"xo": "^0.59.0"
7373
},
7474
"scripts": {
7575
"prepack": "npm run build && npm run format",
@@ -117,6 +117,7 @@
117117
],
118118
"prettier": true,
119119
"rules": {
120+
"logical-assignment-operators": "off",
120121
"max-depth": "off",
121122
"unicorn/prefer-at": "off",
122123
"unicorn/prefer-string-replace-all": "off"

Diff for: readme.md

+72-72
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,30 @@
1212

1313
## Contents
1414

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-
* [`toMdast(tree[, options])`](#tomdasttree-options)
21-
* [`defaultHandlers`](#defaulthandlers)
22-
* [`defaultNodeHandlers`](#defaultnodehandlers)
23-
* [`Handle`](#handle)
24-
* [`NodeHandle`](#nodehandle)
25-
* [`Options`](#options)
26-
* [`State`](#state)
27-
* [Examples](#examples)
28-
* [Example: ignoring things](#example-ignoring-things)
29-
* [Example: keeping some HTML](#example-keeping-some-html)
30-
* [Algorithm](#algorithm)
31-
* [Syntax](#syntax)
32-
* [Syntax tree](#syntax-tree)
33-
* [Types](#types)
34-
* [Compatibility](#compatibility)
35-
* [Security](#security)
36-
* [Related](#related)
37-
* [Contribute](#contribute)
38-
* [License](#license)
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+
* [`toMdast(tree[, options])`](#tomdasttree-options)
21+
* [`defaultHandlers`](#defaulthandlers)
22+
* [`defaultNodeHandlers`](#defaultnodehandlers)
23+
* [`Handle`](#handle)
24+
* [`NodeHandle`](#nodehandle)
25+
* [`Options`](#options)
26+
* [`State`](#state)
27+
* [Examples](#examples)
28+
* [Example: ignoring things](#example-ignoring-things)
29+
* [Example: keeping some HTML](#example-keeping-some-html)
30+
* [Algorithm](#algorithm)
31+
* [Syntax](#syntax)
32+
* [Syntax tree](#syntax-tree)
33+
* [Types](#types)
34+
* [Compatibility](#compatibility)
35+
* [Security](#security)
36+
* [Related](#related)
37+
* [Contribute](#contribute)
38+
* [License](#license)
3939

4040
## What is this?
4141

@@ -119,10 +119,10 @@ Transform hast to mdast.
119119

120120
###### Parameters
121121

122-
* `tree` ([`HastNode`][hast-node])
123-
— hast tree to transform
124-
* `options` ([`Options`][api-options], optional)
125-
— configuration
122+
* `tree` ([`HastNode`][hast-node])
123+
— hast tree to transform
124+
* `options` ([`Options`][api-options], optional)
125+
— configuration
126126

127127
###### Returns
128128

@@ -146,12 +146,12 @@ Handle a particular element (TypeScript type).
146146

147147
###### Parameters
148148

149-
* `state` ([`State`][api-state])
150-
— info passed around about the current state
151-
* `element` ([`Element`][element])
152-
— element to transform
153-
* `parent` ([`HastParent`][hast-parent])
154-
— parent of `element`
149+
* `state` ([`State`][api-state])
150+
— info passed around about the current state
151+
* `element` ([`Element`][element])
152+
— element to transform
153+
* `parent` ([`HastParent`][hast-parent])
154+
— parent of `element`
155155

156156
###### Returns
157157

@@ -163,12 +163,12 @@ Handle a particular node (TypeScript type).
163163

164164
###### Parameters
165165

166-
* `state` ([`State`][api-state])
167-
— info passed around about the current state
168-
* `node` (`any`)
169-
— node to transform
170-
* `parent` ([`HastParent`][hast-parent])
171-
— parent of `node`
166+
* `state` ([`State`][api-state])
167+
— info passed around about the current state
168+
* `node` (`any`)
169+
— node to transform
170+
* `parent` ([`HastParent`][hast-parent])
171+
— parent of `node`
172172

173173
###### Returns
174174

@@ -245,34 +245,34 @@ Info passed around about the current state (TypeScript type).
245245

246246
###### Fields
247247

248-
* `patch` (`(from: HastNode, to: MdastNode) => undefined`)
249-
— copy a node’s positional info
250-
* `one` (`(node: HastNode, parent: HastParent | undefined) => Array<MdastNode> | MdastNode | undefined`)
251-
— transform a hast node to mdast
252-
* `all` (`(parent: HastParent) => Array<MdastContent>`)
253-
— transform the children of a hast parent to mdast
254-
* `toFlow` (`(nodes: Array<MdastContent>) => Array<MdastFlowContent>`)
255-
— transform a list of mdast nodes to flow
256-
* `toSpecificContent` (`<ParentType>(nodes: Array<MdastContent>, build: (() => ParentType)) => Array<ParentType>`)
257-
— turn arbitrary content into a list of a particular node type
258-
* `resolve` (`(url: string | null | undefined) => string`)
259-
— resolve a URL relative to a base
260-
* `options` ([`Options`][api-options])
261-
— user configuration
262-
* `elementById` (`Map<string, Element>`)
263-
— elements by their `id`
264-
* `handlers` (`Record<string, Handle>`)
265-
— applied element handlers (see [`Handle`][api-handle])
266-
* `nodeHandlers` (`Record<string, NodeHandle>`)
267-
— applied node handlers (see [`NodeHandle`][api-node-handle])
268-
* `baseFound` (`boolean`)
269-
— whether a `<base>` element was seen
270-
* `frozenBaseUrl` (`string | undefined`)
271-
`href` of `<base>`, if any
272-
* `inTable` (`boolean`)
273-
— whether we’re in a table
274-
* `qNesting` (`number`)
275-
— how deep we’re in `<q>`s
248+
* `patch` (`(from: HastNode, to: MdastNode) => undefined`)
249+
— copy a node’s positional info
250+
* `one` (`(node: HastNode, parent: HastParent | undefined) => Array<MdastNode> | MdastNode | undefined`)
251+
— transform a hast node to mdast
252+
* `all` (`(parent: HastParent) => Array<MdastContent>`)
253+
— transform the children of a hast parent to mdast
254+
* `toFlow` (`(nodes: Array<MdastContent>) => Array<MdastFlowContent>`)
255+
— transform a list of mdast nodes to flow
256+
* `toSpecificContent` (`<ParentType>(nodes: Array<MdastContent>, build: (() => ParentType)) => Array<ParentType>`)
257+
— turn arbitrary content into a list of a particular node type
258+
* `resolve` (`(url: string | null | undefined) => string`)
259+
— resolve a URL relative to a base
260+
* `options` ([`Options`][api-options])
261+
— user configuration
262+
* `elementById` (`Map<string, Element>`)
263+
— elements by their `id`
264+
* `handlers` (`Record<string, Handle>`)
265+
— applied element handlers (see [`Handle`][api-handle])
266+
* `nodeHandlers` (`Record<string, NodeHandle>`)
267+
— applied node handlers (see [`NodeHandle`][api-node-handle])
268+
* `baseFound` (`boolean`)
269+
— whether a `<base>` element was seen
270+
* `frozenBaseUrl` (`string | undefined`)
271+
`href` of `<base>`, if any
272+
* `inTable` (`boolean`)
273+
— whether we’re in a table
274+
* `qNesting` (`number`)
275+
— how deep we’re in `<q>`s
276276

277277
## Examples
278278

@@ -431,10 +431,10 @@ Use of `hast-util-to-mdast` is safe by default.
431431

432432
## Related
433433

434-
* [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)
435-
— transform hast to nlcst
436-
* [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast)
437-
— transform hast to xast
434+
* [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)
435+
— transform hast to nlcst
436+
* [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast)
437+
— transform hast to xast
438438

439439
## Contribute
440440

0 commit comments

Comments
 (0)