Skip to content

Commit

Permalink
Change to use export map
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 8, 2023
1 parent 801ecd3 commit 09b1c2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @typedef {import('mdast').BlockContent} BlockContent
* @typedef {import('mdast').List} List
* @typedef {import('mdast').Root} Root
* @typedef {import('../index.js').Options} Options
* @typedef {import('mdast-util-toc').Options} Options
*/

/**
Expand All @@ -17,13 +17,15 @@ import fs from 'node:fs/promises'
import test from 'node:test'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmFromMarkdown} from 'mdast-util-gfm'
import {toc} from 'mdast-util-toc'
import {gfm} from 'micromark-extension-gfm'
import {visit} from 'unist-util-visit'
import {toc} from '../index.js'

test('toc', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('../index.js')).sort(), ['toc'])
assert.deepEqual(Object.keys(await import('mdast-util-toc')).sort(), [
'toc'
])
})

await t.test('should fail without node', async function () {
Expand Down

0 comments on commit 09b1c2e

Please sign in to comment.