Skip to content

Commit 491c2da

Browse files
committed
Update dev-dependencies
1 parent a772330 commit 491c2da

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@
1919
"repository": "wooorm/bcp-47-match",
2020
"bugs": "https://github.com/wooorm/bcp-47-match/issues",
2121
"funding": {
22-
"type": "github",
23-
"url": "https://github.com/sponsors/wooorm"
24-
},
22+
"type": "github",
23+
"url": "https://github.com/sponsors/wooorm"
24+
},
2525
"author": "Titus Wormer <[email protected]> (https://wooorm.com)",
2626
"contributors": [
2727
"Titus Wormer <[email protected]> (https://wooorm.com)"
2828
],
2929
"files": [
3030
"index.js"
3131
],
32-
"dependencies": {},
3332
"devDependencies": {
3433
"browserify": "^17.0.0",
3534
"chalk": "^4.0.0",
@@ -39,7 +38,7 @@
3938
"remark-preset-wooorm": "^8.0.0",
4039
"tape": "^5.0.0",
4140
"tinyify": "^3.0.0",
42-
"xo": "^0.37.0"
41+
"xo": "^0.38.0"
4342
},
4443
"scripts": {
4544
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",

test.js

+32-21
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var extended = match.extendedFilter
99
var lookup = match.lookup
1010

1111
test('basic(tags[, ranges="*"])', function (t) {
12-
;[
12+
var basics = [
1313
['de-de', null, ['de-de']],
1414
['de-de', '*', ['de-de']],
1515
['de-DE', '*', ['de-DE']],
@@ -54,7 +54,12 @@ test('basic(tags[, ranges="*"])', function (t) {
5454
['de-de', 'de'],
5555
['de-de', 'de']
5656
]
57-
].forEach(check(t, basic))
57+
]
58+
var index = -1
59+
60+
while (++index < basics.length) {
61+
check(t, basic, basics[index])
62+
}
5863

5964
t.throws(
6065
function () {
@@ -84,7 +89,7 @@ test('basic(tags[, ranges="*"])', function (t) {
8489
})
8590

8691
test('extended(tags[, ranges="*""])', function (t) {
87-
;[
92+
var extendeds = [
8893
['de-de', null, ['de-de']],
8994
['de-de', '*', ['de-de']],
9095
['de-DE', '*', ['de-DE']],
@@ -149,7 +154,12 @@ test('extended(tags[, ranges="*""])', function (t) {
149154
'de-*-DE',
150155
['de-de', 'de-DE-x-goethe', 'de-Deva-DE']
151156
]
152-
].forEach(check(t, extended))
157+
]
158+
var index = -1
159+
160+
while (++index < extendeds.length) {
161+
check(t, extended, extendeds[index])
162+
}
153163

154164
t.throws(
155165
function () {
@@ -179,7 +189,7 @@ test('extended(tags[, ranges="*""])', function (t) {
179189
})
180190

181191
test('lookup(tags[, ranges="*"])', function (t) {
182-
;[
192+
var lookups = [
183193
// Wildcards have no effect in `lookup`
184194
['de-de', null, undefined],
185195
['de-de', '*', undefined],
@@ -210,24 +220,25 @@ test('lookup(tags[, ranges="*"])', function (t) {
210220
'zh-Hant-CN-x-private1-private2',
211221
'zh-Hant'
212222
]
213-
].forEach(check(t, lookup))
223+
]
224+
var index = -1
225+
226+
while (++index < lookups.length) {
227+
check(t, lookup, lookups[index])
228+
}
214229

215230
t.end()
216231
})
217232

218-
function check(t, fn) {
219-
return checker
220-
221-
function checker(options) {
222-
t.deepEqual(
223-
fn(options[0], options[1]),
224-
options[2],
225-
'f(' +
226-
options[0] +
227-
'; ' +
228-
chalk.bold.green(options[1]) +
229-
') -> ' +
230-
chalk.bold(String(options[2]) || '[]')
231-
)
232-
}
233+
function check(t, fn, options) {
234+
t.deepEqual(
235+
fn(options[0], options[1]),
236+
options[2],
237+
'f(' +
238+
options[0] +
239+
'; ' +
240+
chalk.bold.green(options[1]) +
241+
') -> ' +
242+
chalk.bold(String(options[2]) || '[]')
243+
)
233244
}

0 commit comments

Comments
 (0)