Skip to content

Commit 53a04c5

Browse files
committed
chore: format
formatted 99fd78e
1 parent 99fd78e commit 53a04c5

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

packages/react-router-dom/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export type {
103103
RouterProps,
104104
Pathname,
105105
Search,
106-
RoutesProps
106+
RoutesProps,
107107
} from "react-router";
108108

109109
///////////////////////////////////////////////////////////////////////////////

packages/react-router/__tests__/descendant-routes-splat-matching-test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe("Descendant <Routes> splat matching", () => {
108108

109109
it("allows `-` to appear at the beginning", () => {
110110
let renderer = renderNestedSplatRoute([
111-
"/courses/react/-react-fundamentals"
111+
"/courses/react/-react-fundamentals",
112112
]);
113113
expect(renderer.toJSON()).toMatchInlineSnapshot(`
114114
<div>
@@ -134,7 +134,7 @@ describe("Descendant <Routes> splat matching", () => {
134134
});
135135
it("allows `.` to appear at the beginning", () => {
136136
let renderer = renderNestedSplatRoute([
137-
"/courses/react/.react-fundamentals"
137+
"/courses/react/.react-fundamentals",
138138
]);
139139
expect(renderer.toJSON()).toMatchInlineSnapshot(`
140140
<div>
@@ -160,7 +160,7 @@ describe("Descendant <Routes> splat matching", () => {
160160
});
161161
it("allows `~` to appear at the beginning", () => {
162162
let renderer = renderNestedSplatRoute([
163-
"/courses/react/~react-fundamentals"
163+
"/courses/react/~react-fundamentals",
164164
]);
165165
expect(renderer.toJSON()).toMatchInlineSnapshot(`
166166
<div>
@@ -186,7 +186,7 @@ describe("Descendant <Routes> splat matching", () => {
186186
});
187187
it("allows url-encoded entities to appear at the beginning", () => {
188188
let renderer = renderNestedSplatRoute([
189-
"/courses/react/%20react-fundamentals"
189+
"/courses/react/%20react-fundamentals",
190190
]);
191191
expect(renderer.toJSON()).toMatchInlineSnapshot(`
192192
<div>

packages/react-router/__tests__/path-matching-test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,27 @@ describe("path matching with splats", () => {
244244
});
245245

246246
test("nested routes with partial matching", () => {
247-
let routes = [{ path: '/', children: [{ path: 'courses', children: [{ path: '*' }] }] }];
248-
let match = matchRoutes(routes, "/courses/abc")
247+
let routes = [
248+
{ path: "/", children: [{ path: "courses", children: [{ path: "*" }] }] },
249+
];
250+
let match = matchRoutes(routes, "/courses/abc");
249251

250252
expect(match).not.toBeNull();
251253
expect(match).toHaveLength(3);
252254
expect(match[0]).toMatchObject({
253255
params: { "*": "abc" },
254256
pathname: "/",
255-
pathnameBase: "/"
257+
pathnameBase: "/",
256258
});
257259
expect(match[1]).toMatchObject({
258260
params: { "*": "abc" },
259261
pathname: "/courses",
260-
pathnameBase: "/courses"
262+
pathnameBase: "/courses",
261263
});
262264
expect(match[2]).toMatchObject({
263265
params: { "*": "abc" },
264266
pathname: "/courses/abc",
265-
pathnameBase: "/courses"
267+
pathnameBase: "/courses",
266268
});
267269
});
268270
});

packages/react-router/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import type {
88
Path,
99
Pathname,
1010
Search,
11-
To
11+
To,
1212
} from "history";
1313
import {
1414
Action as NavigationType,
1515
createMemoryHistory,
1616
parsePath,
17-
createPath
17+
createPath,
1818
} from "history";
1919

2020
export { parsePath, createPath, NavigationType };
@@ -1044,7 +1044,9 @@ function matchRouteBranch<ParamKey extends string = string>(
10441044
matches.push({
10451045
params: matchedParams,
10461046
pathname: joinPaths([matchedPathname, match.pathname]),
1047-
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),
1047+
pathnameBase: normalizePathname(
1048+
joinPaths([matchedPathname, match.pathnameBase])
1049+
),
10481050
route,
10491051
});
10501052

0 commit comments

Comments
 (0)