Skip to content

Commit 320b2ff

Browse files
committed
Change to use exports
1 parent a6b48ab commit 320b2ff

35 files changed

+37
-38
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
],
2727
"sideEffects": false,
2828
"type": "module",
29-
"main": "index.js",
30-
"types": "index.d.ts",
29+
"exports": "./index.js",
3130
"files": [
3231
"lib/",
3332
"index.d.ts",

test/attribute.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`element` attributes', async (t) => {
88
await t.test('should support unknown properties', async function (t) {

test/comment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3+
import {toHtml} from 'hast-util-to-html'
34
import {u} from 'unist-builder'
4-
import {toHtml} from '../index.js'
55

66
test('`comment`', async function (t) {
77
await t.test('should serialize `comment`s', async function () {

test/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('toHtml()', async function (t) {
88
await t.test('should expose the public api', async function () {
9-
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
9+
assert.deepEqual(Object.keys(await import('hast-util-to-html')).sort(), [
1010
'toHtml'
1111
])
1212
})

test/doctype.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3+
import {toHtml} from 'hast-util-to-html'
34
import {u} from 'unist-builder'
4-
import {toHtml} from '../index.js'
55

66
test('`doctype`', async function (t) {
77
await t.test('should serialize doctypes', async function () {

test/element.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`element`', async function (t) {
77
await t.test('should serialize `element`s', async function () {

test/omission-closing-body.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`body` (closing)', async function (t) {
88
await t.test('should omit tag without following', async function () {

test/omission-closing-caption.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`caption` (closing)', async function (t) {
88
await t.test('should not omit tag without children', async function () {

test/omission-closing-colgroup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`colgroup` (closing)', async function (t) {
88
await t.test('should not omit tag without children', async function () {

test/omission-closing-dd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`dd` (closing)', async function (t) {
77
await t.test('should omit tag without parent', async function () {

test/omission-closing-dt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`dt` (closing)', async function (t) {
77
await t.test('should not omit tag without parent', async function () {

test/omission-closing-head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`head` (closing)', async function (t) {
88
await t.test('should omit tag without following', async function () {

test/omission-closing-html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`html` (closing)', async function (t) {
88
await t.test('should omit tag without following', async function () {

test/omission-closing-li.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`li` (closing)', async function (t) {
77
await t.test('should omit tag without parent', async function () {

test/omission-closing-menuitem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`menuitem` (closing)', async function (t) {
77
await t.test('should omit tag without parent', async function () {

test/omission-closing-optgroup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`optgroup` (closing)', async function (t) {
77
await t.test('should omit tag without parent', async function () {

test/omission-closing-option.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`option` (closing)', async function (t) {
77
await t.test('should omit tag without parent', async function () {

test/omission-closing-p.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`p` (closing)', async function (t) {
88
await t.test('should omit tag without following', async function () {

test/omission-closing-rp-rt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
/**
77
* @param {'rp' | 'rt'} tagName

test/omission-closing-tbody.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`tbody` (closing)', async function (t) {
77
await t.test('should omit tag without siblings', async function () {

test/omission-closing-td-th.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
/**
77
* @param {'td' | 'th'} tagName

test/omission-closing-tfoot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`tfoot` (closing)', async function (t) {
77
await t.test('should omit tag without siblings', async function () {

test/omission-closing-thead.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`thead` (closing)', async function (t) {
77
await t.test('should not omit tag without siblings', async function () {

test/omission-closing-tr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`tr` (closing)', async function (t) {
77
await t.test('should omit tag without siblings', async function () {

test/omission-opening-body.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`body` (opening)', async function (t) {
88
await t.test('should omit tag without children', async function () {

test/omission-opening-colgroup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`colgroup` (opening)', async function (t) {
88
await t.test('should not omit tag without children', async function () {

test/omission-opening-head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`head` (opening)', async function (t) {
77
await t.test('should omit tag with children', async function () {

test/omission-opening-html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`html` (opening)', async function (t) {
88
await t.test('should omit tag without first child', async function () {

test/omission-opening-tbody.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`tbody` (opening)', async function (t) {
77
await t.test('should not omit tag without children', async function () {

test/omission.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4-
import {toHtml} from '../index.js'
4+
import {toHtml} from 'hast-util-to-html'
55

66
test('`omitOptionalTags` mode', async function (t) {
77
await t.test('should omit opening and closing tags', async function () {

test/raw.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import assert from 'node:assert/strict'
66
import test from 'node:test'
7+
import {toHtml} from 'hast-util-to-html'
78
import {u} from 'unist-builder'
8-
import {toHtml} from '../index.js'
99

10-
test('`element`', async function (t) {
10+
test('`raw`', async function (t) {
1111
await t.test('should encode `raw`s', async function () {
1212
assert.deepEqual(
1313
toHtml(u('raw', '<script>alert("XSS!")</script>')),

test/root.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('`root`', async function (t) {
88
await t.test('should serialize `root`s', async function () {

test/security.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('security', async function (t) {
88
await t.test(

test/svg.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h, s} from 'hastscript'
4+
import {toHtml} from 'hast-util-to-html'
45
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
66

77
test('svg', async function (t) {
88
await t.test('should serialize `element`s', async function () {

test/text.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {h} from 'hastscript'
44
import {u} from 'unist-builder'
5-
import {toHtml} from '../index.js'
5+
import {toHtml} from 'hast-util-to-html'
66

77
test('`text`', async function (t) {
88
await t.test('should serialize `text`s', async function () {

0 commit comments

Comments
 (0)