-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a868d1e
commit a3f19eb
Showing
43 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/072-understand-the-ts-server.problem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/072-understand-the-ts-server.solution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/073-understand-how-to-hover-a-variable-to-see-its-type.problem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/073-understand-how-to-hover-a-variable-to-see-its-type.solution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/074-autocomplete-for-object-properties.problem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
1 change: 1 addition & 0 deletions
1
src/025-ide-superpowers/074-autocomplete-for-object-properties.solution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
42 changes: 42 additions & 0 deletions
42
src/028-mutability/084-narrowing-in-different-scopes.problem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { expect, it } from "vitest"; | ||
|
||
const findUsersByName = ( | ||
searchParams: { name?: string }, | ||
users: { | ||
id: string; | ||
name: string; | ||
}[], | ||
) => { | ||
if (searchParams.name) { | ||
return users.filter((user) => user.name.includes(searchParams.name)); | ||
} | ||
|
||
return users; | ||
}; | ||
|
||
it("Should find the exact name", () => { | ||
const result = findUsersByName( | ||
{ | ||
name: "Bob", | ||
}, | ||
[ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Alice", | ||
}, | ||
], | ||
); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
]); | ||
|
||
type test = Expect<Equal<typeof result, { id: string; name: string }[]>>; | ||
}); |
43 changes: 43 additions & 0 deletions
43
src/028-mutability/084-narrowing-in-different-scopes.solution.1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { expect, it } from "vitest"; | ||
|
||
const findUsersByName = ( | ||
searchParams: { name?: string }, | ||
users: { | ||
id: string; | ||
name: string; | ||
}[], | ||
) => { | ||
let name = searchParams.name; | ||
if (name) { | ||
return users.filter((user) => user.name.includes(name)); | ||
} | ||
|
||
return users; | ||
}; | ||
|
||
it("Should find the exact name", () => { | ||
const result = findUsersByName( | ||
{ | ||
name: "Bob", | ||
}, | ||
[ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Alice", | ||
}, | ||
], | ||
); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
]); | ||
|
||
type test = Expect<Equal<typeof result, { id: string; name: string }[]>>; | ||
}); |
43 changes: 43 additions & 0 deletions
43
src/028-mutability/084-narrowing-in-different-scopes.solution.2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { expect, it } from "vitest"; | ||
|
||
const findUsersByName = ( | ||
searchParams: { name?: string }, | ||
users: { | ||
id: string; | ||
name: string; | ||
}[], | ||
) => { | ||
const name = searchParams.name; | ||
if (name) { | ||
return users.filter((user) => user.name.includes(name)); | ||
} | ||
|
||
return users; | ||
}; | ||
|
||
it("Should find the exact name", () => { | ||
const result = findUsersByName( | ||
{ | ||
name: "Bob", | ||
}, | ||
[ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Alice", | ||
}, | ||
], | ||
); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
id: "1", | ||
name: "Bob", | ||
}, | ||
]); | ||
|
||
type test = Expect<Equal<typeof result, { id: string; name: string }[]>>; | ||
}); |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.