Skip to content

Commit 6dacb52

Browse files
committed
Change to use export map
1 parent 4e4061b commit 6dacb52

15 files changed

+18
-19
lines changed

index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {expectNotType, expectType} from 'tsd'
22
import type {Node, Parent} from 'unist'
3-
import {assert, parent} from './index.js'
3+
import {assert, parent} from 'unist-util-assert'
44

55
const emptyNode = {type: 'a'}
66
const literalNode = {type: 'b', value: 'c'}

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
import nodeAssert from 'node:assert'
29-
import {inspect} from './inspect.js'
29+
import {inspect} from 'unist-util-assert/do-not-use-conditional-inspect'
3030

3131
const own = {}.hasOwnProperty
3232

File renamed without changes.
File renamed without changes.

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
],
2525
"sideEffects": false,
2626
"type": "module",
27-
"main": "index.js",
28-
"browser": {
29-
"./lib/inspect.js": "./lib/inspect.browser.js"
27+
"exports": {
28+
".": "./index.js",
29+
"./do-not-use-conditional-inspect": {
30+
"node": "./lib/inspect.node.js",
31+
"default": "./lib/inspect.default.js"
32+
}
3033
},
31-
"react-native": {
32-
"./lib/inspect.js": "./lib/inspect.browser.js"
33-
},
34-
"types": "index.d.ts",
3534
"files": [
3635
"lib/",
3736
"index.d.ts",

test/children.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('children', async function (t) {
66
await t.test(

test/core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import test from 'node:test'
33

44
test('assert', async function (t) {
55
await t.test('should expose the public api', async function () {
6-
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
6+
assert.deepEqual(Object.keys(await import('unist-util-assert')).sort(), [
77
'_void',
88
'assert',
99
'literal',

test/literal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {literal} from '../index.js'
3+
import {literal} from 'unist-util-assert'
44

55
test('literal()', async function (t) {
66
await t.test('should throw the same errors as `assert()`', async function () {

test/node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('node', async function (t) {
66
await t.test('should throw if not given a node (#1)', async function () {

test/non-defined.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('non-defined', async function (t) {
66
await t.test(

test/parent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {parent} from '../index.js'
3+
import {parent} from 'unist-util-assert'
44

55
test('parent()', async function (t) {
66
await t.test('should throw the same errors as `assert()`', async function () {

test/position.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('position', async function (t) {
66
await t.test(

test/type.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('type', async function (t) {
66
await t.test('should throw if not given a `type` (#1)', async function () {

test/value.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nodeAssert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {assert} from '../index.js'
3+
import {assert} from 'unist-util-assert'
44

55
test('value', async function (t) {
66
await t.test('should throw if given a non-string `value`', async function () {

test/void.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
3-
import {_void} from '../index.js'
3+
import {_void} from 'unist-util-assert'
44

55
test('_void()', async function (t) {
66
await t.test('should throw the same errors as `assert()`', async function () {

0 commit comments

Comments
 (0)