Skip to content

Commit bda0adb

Browse files
committed
Change to use exports
1 parent 6e5498f commit bda0adb

11 files changed

+14
-13
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
],
2424
"sideEffects": false,
2525
"type": "module",
26-
"main": "index.js",
27-
"types": "index.d.ts",
26+
"exports": "./index.js",
2827
"files": [
2928
"lib/",
3029
"index.d.ts",

test/attribute.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 {u} from 'unist-builder'
44
import {x} from 'xastscript'
5-
import {toXml} from '../index.js'
5+
import {toXml} from 'xast-util-to-xml'
66

77
test('`element` attributes', async function (t) {
88
await t.test('should ignore missing attributes', async function () {

test/cdata.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 {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

66
test('`cdata`', async function (t) {
77
await t.test('should not encode `cdata`s', async function () {

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'
33
import {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

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

test/core.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

66
test('toXml()', async function (t) {
77
await t.test('should expose the public api', async function () {
8-
assert.deepEqual(Object.keys(await import('../index.js')).sort(), ['toXml'])
8+
assert.deepEqual(Object.keys(await import('xast-util-to-xml')).sort(), [
9+
'toXml'
10+
])
911
})
1012

1113
await t.test('should throw on non-nodes', async function () {

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'
33
import {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

66
test('`doctype`', async function (t) {
77
await t.test('should serialize doctypes without `name`', 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 {x} from 'xastscript'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

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

test/instruction.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 {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

66
test('`instruction`', async function (t) {
77
await t.test(

test/raw.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 {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

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

test/root.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 {u} from 'unist-builder'
44
import {x} from 'xastscript'
5-
import {toXml} from '../index.js'
5+
import {toXml} from 'xast-util-to-xml'
66

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

test/text.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 {u} from 'unist-builder'
4-
import {toXml} from '../index.js'
4+
import {toXml} from 'xast-util-to-xml'
55

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

0 commit comments

Comments
 (0)