Skip to content

Commit 765021e

Browse files
committed
Replace all export with state.all
1 parent c2fab89 commit 765021e

File tree

19 files changed

+46
-46
lines changed

19 files changed

+46
-46
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* @typedef {import('./lib/types.js').Options} Options
55
*/
66

7-
export {one, all, defaultHandlers, toMdast} from './lib/index.js'
7+
export {one, defaultHandlers, toMdast} from './lib/index.js'

lib/handlers/a.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
87
import {resolve} from '../util/resolve.js'
98

109
/**
@@ -24,7 +23,7 @@ export function a(state, node) {
2423
url: resolve(state, String(properties.href || '') || null),
2524
title: properties.title ? String(properties.title) : null,
2625
// @ts-expect-error: assume valid children.
27-
children: all(state, node)
26+
children: state.all(node)
2827
}
2928
state.patch(node, result)
3029
return result

lib/handlers/del.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
/**
108
* @param {State} state
119
* State.
@@ -19,7 +17,7 @@ export function del(state, node) {
1917
const result = {
2018
type: 'delete',
2119
// @ts-expect-error: assume valid children.
22-
children: all(state, node)
20+
children: state.all(node)
2321
}
2422
state.patch(node, result)
2523
return result

lib/handlers/em.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
/**
108
* @param {State} state
119
* State.
@@ -19,7 +17,7 @@ export function em(state, node) {
1917
const result = {
2018
type: 'emphasis',
2119
// @ts-expect-error: assume valid children.
22-
children: all(state, node)
20+
children: state.all(node)
2321
}
2422
state.patch(node, result)
2523
return result

lib/handlers/heading.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
/**
108
* @param {State} state
119
* State.
@@ -24,7 +22,7 @@ export function heading(state, node) {
2422
// @ts-expect-error: fine.
2523
depth,
2624
// @ts-expect-error: assume valid children.
27-
children: all(state, node)
25+
children: state.all(node)
2826
}
2927
state.patch(node, result)
3028
return result

lib/handlers/media.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {toString} from 'mdast-util-to-string'
1010
import {visit, EXIT} from 'unist-util-visit'
11-
import {all} from '../all.js'
1211
import {resolve} from '../util/resolve.js'
1312
import {wrapNeeded} from '../util/wrap.js'
1413

@@ -26,7 +25,7 @@ export function media(state, node) {
2625
let src = String(properties.src || '')
2726
let index = -1
2827
let linkInFallbackContent = false
29-
let nodes = all(state, node)
28+
let nodes = state.all(node)
3029

3130
visit({type: 'root', children: nodes}, 'link', findLink)
3231

lib/handlers/p.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
/**
108
* @param {State} state
119
* State.
@@ -15,7 +13,7 @@ import {all} from '../all.js'
1513
* mdast node.
1614
*/
1715
export function p(state, node) {
18-
const nodes = all(state, node)
16+
const nodes = state.all(node)
1917

2018
if (nodes.length > 0) {
2119
/** @type {Paragraph} */

lib/handlers/q.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
const defaultQuotes = ['"']
108

119
/**
@@ -20,7 +18,7 @@ export function q(state, node) {
2018
const quotes = state.options.quotes || defaultQuotes
2119

2220
state.qNesting++
23-
const contents = all(state, node)
21+
const contents = state.all(node)
2422
state.qNesting--
2523

2624
const quote = quotes[state.qNesting % quotes.length]

lib/handlers/root.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
87
import {wrap, wrapNeeded} from '../util/wrap.js'
98

109
/**
@@ -16,7 +15,7 @@ import {wrap, wrapNeeded} from '../util/wrap.js'
1615
* mdast node.
1716
*/
1817
export function root(state, node) {
19-
let children = all(state, node)
18+
let children = state.all(node)
2019

2120
if (state.options.document || wrapNeeded(children)) {
2221
// @ts-expect-error: improve `all`?

lib/handlers/strong.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @typedef {import('../types.js').State} State
55
*/
66

7-
import {all} from '../all.js'
8-
97
/**
108
* @param {State} state
119
* State.
@@ -19,7 +17,7 @@ export function strong(state, node) {
1917
const result = {
2018
type: 'strong',
2119
// @ts-expect-error: assume valid children.
22-
children: all(state, node)
20+
children: state.all(node)
2321
}
2422
state.patch(node, result)
2523
return result

0 commit comments

Comments
 (0)