Skip to content

Commit 21f03b2

Browse files
committed
Change to use export map
1 parent b81a3a0 commit 21f03b2

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed
File renamed without changes.
File renamed without changes.

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Whether to include positional information.
1515
*/
1616

17-
import {color} from './color.js'
17+
import {color} from 'unist-util-inspect/do-not-use-conditional-color'
1818

1919
/**
2020
* Inspect a node, with color in Node, without color in browsers.

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@
2525
],
2626
"sideEffects": false,
2727
"type": "module",
28-
"main": "index.js",
29-
"browser": {
30-
"./lib/color.js": "./lib/color-browser.js"
28+
"exports": {
29+
".": "./index.js",
30+
"./do-not-use-conditional-color": {
31+
"node": "./lib/color.node.js",
32+
"default": "./lib/color.default.js"
33+
}
3134
},
32-
"react-native": {
33-
"./lib/color.js": "./lib/color-browser.js"
34-
},
35-
"types": "index.d.ts",
3635
"files": [
3736
"lib/",
3837
"index.d.ts",

test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ import assert from 'node:assert/strict'
66
import test from 'node:test'
77
/* eslint-disable-next-line unicorn/import-style */
88
import {Chalk} from 'chalk'
9+
import {h} from 'hastscript'
10+
import {retext} from 'retext'
911
import strip from 'strip-ansi'
1012
import {u} from 'unist-builder'
11-
import {h} from 'hastscript'
13+
import {inspect, inspectColor, inspectNoColor} from 'unist-util-inspect'
1214
import {x} from 'xastscript'
13-
import {retext} from 'retext'
1415
import {fromXml} from 'xast-util-from-xml'
15-
import {inspect, inspectColor, inspectNoColor} from './index.js'
1616

1717
const chalkEnabled = new Chalk({level: 1})
1818

1919
const paragraph = 'Some simple text. Other “sentence”.'
2020

2121
test('inspect()', async function (t) {
2222
await t.test('should expose the public api', async function () {
23-
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
23+
assert.deepEqual(Object.keys(await import('unist-util-inspect')).sort(), [
2424
'inspect',
2525
'inspectColor',
2626
'inspectNoColor'

0 commit comments

Comments
 (0)