Skip to content

Commit 94d0af0

Browse files
committed
Use ESM
1 parent aea187c commit 94d0af0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+389
-550
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
.DS_Store
22
*.log
3-
.nyc_output/
43
coverage/
54
node_modules/
6-
mdast-util-to-hast.js
7-
mdast-util-to-hast.min.js
85
yarn.lock

.prettierignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
.nyc_output/
21
coverage/
3-
mdast-util-to-hast.js
4-
mdast-util-to-hast.min.js
52
*.md

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
'use strict'
2-
module.exports = require('./lib')
1+
export {toHast} from './lib/index.js'

lib/all.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
'use strict'
1+
import {one} from './one.js'
22

3-
module.exports = all
4-
5-
var one = require('./one')
6-
7-
function all(h, parent) {
3+
export function all(h, parent) {
84
var nodes = parent.children || []
95
var length = nodes.length
106
var values = []

lib/footer.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
'use strict'
1+
import {thematicBreak} from './handlers/thematic-break.js'
2+
import {list} from './handlers/list.js'
3+
import {wrap} from './wrap.js'
24

3-
module.exports = generateFootnotes
4-
5-
var thematicBreak = require('./handlers/thematic-break')
6-
var list = require('./handlers/list')
7-
var wrap = require('./wrap')
8-
9-
function generateFootnotes(h) {
5+
export function footer(h) {
106
var footnoteById = h.footnoteById
117
var footnoteOrder = h.footnoteOrder
128
var length = footnoteOrder.length

lib/handlers/blockquote.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
'use strict'
1+
import {wrap} from '../wrap.js'
2+
import {all} from '../all.js'
23

3-
module.exports = blockquote
4-
5-
var wrap = require('../wrap')
6-
var all = require('../all')
7-
8-
function blockquote(h, node) {
4+
export function blockquote(h, node) {
95
return h(node, 'blockquote', wrap(all(h, node), true))
106
}

lib/handlers/break.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
'use strict'
1+
import {u} from 'unist-builder'
22

3-
module.exports = hardBreak
4-
5-
var u = require('unist-builder')
6-
7-
function hardBreak(h, node) {
3+
export function hardBreak(h, node) {
84
return [h(node, 'br'), u('text', '\n')]
95
}

lib/handlers/code.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
'use strict'
1+
import {u} from 'unist-builder'
22

3-
module.exports = code
4-
5-
var u = require('unist-builder')
6-
7-
function code(h, node) {
3+
export function code(h, node) {
84
var value = node.value ? node.value + '\n' : ''
95
// To do: next major, use `node.lang` w/o regex, the splitting’s been going
106
// on for years in remark now.

lib/handlers/delete.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
'use strict'
1+
import {all} from '../all.js'
22

3-
module.exports = strikethrough
4-
5-
var all = require('../all')
6-
7-
function strikethrough(h, node) {
3+
export function strikethrough(h, node) {
84
return h(node, 'del', all(h, node))
95
}

lib/handlers/emphasis.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
'use strict'
1+
import {all} from '../all.js'
22

3-
module.exports = emphasis
4-
5-
var all = require('../all')
6-
7-
function emphasis(h, node) {
3+
export function emphasis(h, node) {
84
return h(node, 'em', all(h, node))
95
}

0 commit comments

Comments
 (0)