Skip to content

Commit

Permalink
Refactor to use @imports
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 13, 2024
1 parent 9cf3f53 commit 730eafb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @typedef {import('unist').Point} Point
*
* @typedef {import('../index.js').Options} Options
* @import {Point} from 'unist'
* @import {Options} from '../index.js'
*/

import {characterEntitiesLegacy} from 'character-entities-legacy'
Expand Down
13 changes: 9 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @import {Point, Position} from 'unist'
* @import {Options} from './index.js'
*/

import assert from 'node:assert/strict'
import test from 'node:test'
import {parseEntities} from './index.js'
Expand Down Expand Up @@ -564,16 +569,16 @@ test('parseEntities(value)', function () {

/**
* @param {string} fixture
* @param {import('./index.js').Options} [options={}]
* @param {Options} [options={}]
*/
function check(fixture, options = {}) {
const result = {
result: '',
/** @type {Array.<[string, import('unist').Position, string]>} */
/** @type {Array.<[string, Position, string]>} */
reference: [],
/** @type {Array.<[string, import('unist').Position]>} */
/** @type {Array.<[string, Position]>} */
text: [],
/** @type {Array.<[string, import('unist').Point, number]>} */
/** @type {Array.<[string, Point, number]>} */
warning: []
}

Expand Down

0 comments on commit 730eafb

Please sign in to comment.