Skip to content

Commit 2eef3eb

Browse files
authored
chore(deps): Bump deps (#4970)
1 parent 54c9e2d commit 2eef3eb

File tree

9 files changed

+2542
-5751
lines changed

9 files changed

+2542
-5751
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
node:
28-
- 18
2928
- 20
3029
- 22
30+
- 24
3131
- lts/*
3232

3333
steps:

package-lock.json

Lines changed: 799 additions & 1468 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"parse5": "^7.3.0",
126126
"parse5-htmlparser2-tree-adapter": "^7.1.0",
127127
"parse5-parser-stream": "^7.1.2",
128-
"undici": "^7.12.0",
128+
"undici": "^7.16.0",
129129
"whatwg-mimetype": "^4.0.0"
130130
},
131131
"devDependencies": {
@@ -134,28 +134,28 @@
134134
"@imgix/js-core": "^3.8.0",
135135
"@octokit/graphql": "^9.0.3",
136136
"@types/jsdom": "^27.0.0",
137-
"@types/node": "^24.10.1",
137+
"@types/node": "^25.0.3",
138138
"@types/whatwg-mimetype": "^3.0.2",
139-
"@vitest/coverage-v8": "^3.2.4",
140-
"@vitest/eslint-plugin": "^1.4.3",
141-
"eslint": "^9.39.1",
139+
"@vitest/coverage-v8": "^4.0.16",
140+
"@vitest/eslint-plugin": "^1.5.4",
141+
"eslint": "^9.39.2",
142142
"eslint-config-prettier": "^10.1.8",
143-
"eslint-plugin-jsdoc": "^61.4.1",
143+
"eslint-plugin-jsdoc": "^61.5.0",
144144
"eslint-plugin-n": "^17.23.1",
145-
"eslint-plugin-unicorn": "^59.0.1",
145+
"eslint-plugin-unicorn": "^62.0.0",
146146
"globals": "^16.5.0",
147147
"husky": "^9.1.7",
148148
"jquery": "^3.7.1",
149-
"jsdom": "^27.2.0",
149+
"jsdom": "^27.3.0",
150150
"lint-staged": "^16.2.7",
151-
"prettier": "^3.6.2",
152-
"prettier-plugin-jsdoc": "^1.5.0",
153-
"tinybench": "^5.1.0",
151+
"prettier": "^3.7.4",
152+
"prettier-plugin-jsdoc": "^1.8.0",
153+
"tinybench": "^6.0.0",
154154
"tshy": "^3.1.0",
155-
"tsx": "^4.20.6",
156-
"typescript": "^5.9.2",
157-
"typescript-eslint": "^8.47.0",
158-
"vitest": "^3.1.4"
155+
"tsx": "^4.21.0",
156+
"typescript": "^5.9.3",
157+
"typescript-eslint": "^8.50.0",
158+
"vitest": "^4.0.16"
159159
},
160160
"engines": {
161161
"node": ">=20.18.1"

src/api/attributes.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ describe('$(...)', () => {
11361136
it('(fn) : should work with no initial class attribute', () => {
11371137
const $inputs = load(inputs);
11381138
$inputs('input, select').toggleClass(function () {
1139-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- `get` should never return undefined here.
11401139
return $inputs(this).get(0)!.tagName === 'select'
11411140
? 'selectable'
11421141
: 'inputable';

src/api/traversing.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,15 @@ export const parents: <T extends AnyNode>(
273273
selector?: AcceptedFilters<Element>,
274274
) => Cheerio<Element> = _matcher(
275275
(elem) => {
276-
const matched = [];
276+
const matched: Element[] = [];
277277
while (elem.parent && !isDocument(elem.parent)) {
278278
matched.push(elem.parent as Element);
279279
elem = elem.parent;
280280
}
281281
return matched;
282282
},
283283
uniqueSort,
284+
// eslint-disable-next-line unicorn/no-array-reverse
284285
(elems) => elems.reverse(),
285286
);
286287

@@ -309,6 +310,7 @@ export const parentsUntil: <T extends AnyNode>(
309310
) => Cheerio<Element> = _matchUntil(
310311
({ parent }) => (parent && !isDocument(parent) ? (parent as Element) : null),
311312
uniqueSort,
313+
// eslint-disable-next-line unicorn/no-array-reverse
312314
(elems) => elems.reverse(),
313315
);
314316

src/index.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,23 @@ describe('fromURL', () => {
199199
});
200200

201201
it('should follow redirects', async () => {
202-
let redirected = false;
202+
let firstRequestUrl: string | undefined;
203+
let secondRequestUrl: string | undefined;
203204
const port = await createTestServer('text/html', TEST_HTML, (req, res) => {
204-
if (redirected) {
205-
expect(req.url).toBe('/final/path');
206-
res.writeHead(200, { 'Content-Type': 'text/html' });
207-
res.end(TEST_HTML);
208-
} else {
209-
expect(req.url).toBe('/first');
210-
redirected = true;
205+
if (firstRequestUrl === undefined) {
206+
firstRequestUrl = req.url;
211207
res.writeHead(302, { Location: `http://localhost:${port}/final/path` });
212208
res.end();
209+
} else {
210+
secondRequestUrl = req.url;
211+
res.writeHead(200, { 'Content-Type': 'text/html' });
212+
res.end(TEST_HTML);
213213
}
214214
});
215215

216216
const $ = await cheerio.fromURL(`http://localhost:${port}/first`);
217+
expect(firstRequestUrl).toBe('/first');
218+
expect(secondRequestUrl).toBe('/final/path');
217219
expect($.html()).toBe(
218220
`<html><head></head><body>${TEST_HTML}</body></html>`,
219221
);

src/options.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import type { DomSerializerOptions } from 'dom-serializer';
1111
* @see https://github.com/fb55/htmlparser2/wiki/Parser-options
1212
*/
1313
export interface HTMLParser2Options
14-
extends DomHandlerOptions,
15-
DomSerializerOptions,
16-
HTMLParser2ParserOptions {
14+
extends DomHandlerOptions, DomSerializerOptions, HTMLParser2ParserOptions {
1715
/** Treat the input as an XML document. */
1816
xmlMode?: boolean;
1917
}
@@ -24,8 +22,7 @@ export interface HTMLParser2Options
2422
* Please note that parser-specific options are _only recognized_ if the
2523
* relevant parser is used.
2624
*/
27-
export interface CheerioOptions
28-
extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {
25+
export interface CheerioOptions extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {
2926
/**
3027
* Recommended way of configuring htmlparser2 when wanting to parse XML.
3128
*
@@ -88,8 +85,7 @@ export interface CheerioOptions
8885

8986
/** Internal options for Cheerio. */
9087
export interface InternalOptions
91-
extends HTMLParser2Options,
92-
Omit<CheerioOptions, 'xml'> {
88+
extends HTMLParser2Options, Omit<CheerioOptions, 'xml'> {
9389
/**
9490
* Whether to use htmlparser2.
9591
*

0 commit comments

Comments
 (0)