Skip to content

Commit 2a37eae

Browse files
committed
Change to use exports
1 parent 851c204 commit 2a37eae

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
],
2929
"sideEffects": false,
3030
"type": "module",
31-
"main": "index.js",
32-
"types": "index.d.ts",
31+
"exports": "./index.js",
3332
"files": [
3433
"lib/",
3534
"index.d.ts",

test.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ import assert from 'node:assert/strict'
66
import test from 'node:test'
77
import {frontmatter} from 'micromark-extension-frontmatter'
88
import {fromMarkdown} from 'mdast-util-from-markdown'
9+
import {
10+
frontmatterFromMarkdown,
11+
frontmatterToMarkdown
12+
} from 'mdast-util-frontmatter'
913
import {toMarkdown} from 'mdast-util-to-markdown'
1014
import {removePosition} from 'unist-util-remove-position'
11-
import {frontmatterFromMarkdown, frontmatterToMarkdown} from './index.js'
1215

1316
const custom = {type: 'custom', marker: {open: '<', close: '>'}}
1417
const json = {type: 'json', fence: {open: '{', close: '}'}}
1518
const yamlAnywhere = {type: 'yaml', marker: '-', anywhere: true}
1619

1720
test('core', async function (t) {
1821
await t.test('should expose the public api', async function () {
19-
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
20-
'frontmatterFromMarkdown',
21-
'frontmatterToMarkdown'
22-
])
22+
assert.deepEqual(
23+
Object.keys(await import('mdast-util-frontmatter')).sort(),
24+
['frontmatterFromMarkdown', 'frontmatterToMarkdown']
25+
)
2326
})
2427
})
2528

0 commit comments

Comments
 (0)