Skip to content

Commit c99dd92

Browse files
committed
format code
1 parent b79e5d4 commit c99dd92

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/utils/get-relative-path.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ function getIsFsCaseSensitive() {
4646
return isCaseSensitiveFilesystem;
4747
}
4848

49-
/**
50-
* @private The export is only for unit tests
51-
*/
49+
/** @private The Export is only for unit tests */
5250
export function getMatchPortion(from: string, to: string) {
5351
const lowerFrom = from.toLocaleLowerCase();
5452
const lowerTo = to.toLocaleLowerCase();

test/tests/get-match-portion.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { getMatchPortion } from '../../src/utils/get-relative-path'
1+
import { getMatchPortion } from "../../src/utils/get-relative-path";
22

33
describe(`getMatchPortion`, () => {
4-
it("works in a simple case", () => {
5-
expect(getMatchPortion("/foo/bar", "/foo/quux")).toBe("/foo/");
6-
});
4+
it("works in a simple case", () => {
5+
expect(getMatchPortion("/foo/bar", "/foo/quux")).toBe("/foo/");
6+
});
77

8-
// We use the function getMatchPortion to generate a new path for “to”, so let’s preserve
9-
// the case where possible.
10-
// Otherwise we are introducing inconsistency for our users, who may have had import from Foo,
11-
// their file is named Foo, but we rewrite the path to foo.
12-
// Although the file is still accessible in the file system, other tools might reasonably
13-
// complain about the unexpected case mismatch.
14-
it("prioritizes the casing of the “to” parameter", () => {
15-
expect(getMatchPortion("/foo/bar", "/foO/quux")).toBe("/foO/");
16-
expect(getMatchPortion("/foo/bar", "/foo/Bonk")).toBe("/foo/B");
17-
});
8+
// We use the function getMatchPortion to generate a new path for “to”, so let’s preserve
9+
// the case where possible.
10+
// Otherwise we are introducing inconsistency for our users, who may have had import from Foo,
11+
// their file is named Foo, but we rewrite the path to foo.
12+
// Although the file is still accessible in the file system, other tools might reasonably
13+
// complain about the unexpected case mismatch.
14+
it("prioritizes the casing of the “to” parameter", () => {
15+
expect(getMatchPortion("/foo/bar", "/foO/quux")).toBe("/foO/");
16+
expect(getMatchPortion("/foo/bar", "/foo/Bonk")).toBe("/foo/B");
17+
});
1818
});

0 commit comments

Comments
 (0)