Skip to content

Commit dbb57ba

Browse files
fix format with prettier
1 parent d5f294d commit dbb57ba

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/open-next/src/core/routing/matcher.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,13 @@ export function handleRewrites<T extends RewriteDefinition>(
205205
// https://github.com/pillarjs/path-to-regexp?tab=readme-ov-file#unexpected--or-
206206
// 2. The convertToQueryString function will replace the "+" character with %2B instead of %20.
207207
// %2B does not get interpreted as a space in the URL thus breaking the query string.
208-
const encodePlusQueryString = queryString.replaceAll("+", "%20")
208+
const encodePlusQueryString = queryString.replaceAll("+", "%20");
209209
debug("urlParts", { pathname, protocol, hostname, queryString });
210210
const toDestinationPath = compile(escapeRegex(pathname ?? "") ?? "");
211211
const toDestinationHost = compile(escapeRegex(hostname ?? "") ?? "");
212-
const toDestinationQuery = compile(escapeRegex(encodePlusQueryString ?? "") ?? "");
212+
const toDestinationQuery = compile(
213+
escapeRegex(encodePlusQueryString ?? "") ?? "",
214+
);
213215
let params = {
214216
// params for the source
215217
...getParamsFromSource(match(escapeRegex(rewrite?.source) ?? ""))(

packages/tests-unit/tests/core/routing/matcher.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,14 @@ describe("handleRedirects", () => {
277277
source: "/foo",
278278
destination: "/search?bar=hello+world&baz=new%2C+earth",
279279
internal: true,
280-
statusCode: 308
280+
statusCode: 308,
281281
},
282282
]);
283283

284284
expect(result.statusCode).toEqual(308);
285-
expect(result.headers.Location).toEqual("/search?bar=hello+world&baz=new%2C+earth");
285+
expect(result.headers.Location).toEqual(
286+
"/search?bar=hello+world&baz=new%2C+earth",
287+
);
286288
});
287289
});
288290

0 commit comments

Comments
 (0)