Skip to content

Commit

Permalink
Change to use exports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 7, 2023
1 parent db5ea46 commit 1a7cb9f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/id.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @typedef {import('css-selector-parser').AstRule} AstRule
*
* @typedef {import('./index.js').Element} Element
* @typedef {import('hast').Element} Element
*/

import {ok as assert} from 'devlop'
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions test/core.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {h} from 'hastscript'
import {selectAll} from 'hast-util-select'
import {u} from 'unist-builder'
import {selectAll} from '../index.js'

test('hast-util-select', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('../index.js')).sort(), [
assert.deepEqual(Object.keys(await import('hast-util-select')).sort(), [
'matches',
'select',
'selectAll'
Expand Down
2 changes: 1 addition & 1 deletion test/matches.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {h, s} from 'hastscript'
import {matches} from 'hast-util-select'
import {u} from 'unist-builder'
import {matches} from '../index.js'

test('select.matches()', async function (t) {
await t.test('invalid selector', async function (t) {
Expand Down
2 changes: 1 addition & 1 deletion test/select-all.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {h, s} from 'hastscript'
import {selectAll} from 'hast-util-select'
import {u} from 'unist-builder'
import {selectAll} from '../index.js'

test('select.selectAll()', async function (t) {
await t.test('invalid selectors', async function (t) {
Expand Down
2 changes: 1 addition & 1 deletion test/select.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {h, s} from 'hastscript'
import {select} from 'hast-util-select'
import {u} from 'unist-builder'
import {select} from '../index.js'

test('select.select()', async function (t) {
await t.test('invalid selectors', async function (t) {
Expand Down
2 changes: 1 addition & 1 deletion test/svg.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {h, s} from 'hastscript'
import {select, selectAll} from 'hast-util-select'
import {u} from 'unist-builder'
import {select, selectAll} from '../index.js'

test('svg', async function (t) {
await t.test('should match svg (#1)', async function () {
Expand Down

0 comments on commit 1a7cb9f

Please sign in to comment.