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 6, 2023
1 parent 07c45fa commit a5ac22a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ In browsers with [`esm.sh`][esmsh]:
## Use

```js
import {u} from 'unist-builder'
import {normalizeHeadings} from 'mdast-normalize-headings'
import {u} from 'unist-builder'

const tree = u('root', [
u('heading', {depth: 1}, [u('text', 'title')]),
Expand Down
9 changes: 5 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import test from 'node:test'
import {normalizeHeadings} from 'mdast-normalize-headings'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {removePosition} from 'unist-util-remove-position'
import {normalizeHeadings} from '../index.js'

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

/** @type {Record<string, string>} */
Expand Down

0 comments on commit a5ac22a

Please sign in to comment.