Skip to content

Commit edd9c3e

Browse files
committed
Update dev-dependencies
1 parent 03f0ad1 commit edd9c3e

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

lib/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
*/
66

77
/**
8-
* @typedef Dictionary
9-
* A hunspell dictionary.
10-
* @property {Uint8Array} aff
11-
* Data for the affix file (defines the language, keyboard, flags, and more).
12-
* @property {Uint8Array} dic
13-
* Data for the dictionary file (contains words and flags applying to those words).
14-
*
158
* @callback DictionaryCallback
169
* Dictionary function.
1710
* @param {DictionaryOnLoad} onload
@@ -32,9 +25,16 @@
3225
*
3326
* Note: `void` included until TS infers it.
3427
*
28+
* @typedef Dictionary
29+
* A hunspell dictionary.
30+
* @property {Uint8Array} aff
31+
* Data for the affix file (defines the language, keyboard, flags, and more).
32+
* @property {Uint8Array} dic
33+
* Data for the dictionary file (contains words and flags applying to those words).
34+
*
3535
* @typedef Options
3636
* Configuration.
37-
* @property {Dictionary | DictionaryCallback} dictionary
37+
* @property {DictionaryCallback | Dictionary} dictionary
3838
* Dictionary (required);
3939
* result of importing one of the dictionaries in `wooorm/dictionaries`.
4040
* @property {ReadonlyArray<string> | null | undefined} [ignore]

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@
4848
},
4949
"devDependencies": {
5050
"@types/node": "^20.0.0",
51-
"c8": "^8.0.0",
52-
"dictionary-en": "^3.0.0",
53-
"dictionary-en-v4": "npm:dictionary-en@^4.0.0",
51+
"c8": "^9.0.0",
52+
"dictionary-en": "^4.0.0",
5453
"prettier": "^3.0.0",
5554
"remark-cli": "^11.0.0",
5655
"remark-preset-wooorm": "^9.0.0",

test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import dictionaryEn from 'dictionary-en'
4-
import dictionaryEnV4 from 'dictionary-en-v4'
54
import {retext} from 'retext'
65
import retextEmoji from 'retext-emoji'
76
import retextSpell from 'retext-spell'
@@ -79,9 +78,13 @@ test('retextSpell', async function (t) {
7978
])
8079
})
8180

82-
await t.test('should work with newer dictionary versions', async function () {
81+
await t.test('should work with dictionary callbacks', async function () {
8382
const file = await retext()
84-
.use(retextSpell, dictionaryEnV4)
83+
.use(retextSpell, function (onload) {
84+
setTimeout(function () {
85+
onload(undefined, dictionaryEn)
86+
}, 10)
87+
})
8588
.process('kolor')
8689

8790
assert.deepEqual(file.messages.map(String), [

0 commit comments

Comments
 (0)