From 09b1c2ef657a191822898c1a62011806be183768 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 8 Jul 2023 10:53:44 +0200 Subject: [PATCH] Change to use `export` map --- package.json | 3 +-- test/index.js | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6b331b7..f95b13b 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,7 @@ ], "sideEffects": false, "type": "module", - "main": "index.js", - "types": "index.d.ts", + "exports": "./index.js", "files": [ "lib/", "index.d.ts", diff --git a/test/index.js b/test/index.js index 132405c..ae2d6fb 100644 --- a/test/index.js +++ b/test/index.js @@ -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 */ /** @@ -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 () {