Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

chore: switch challenge to use MyPick

bautistaaaa3ab35140d14
diff --git a/challenges/pick/tests.ts b/challenges/pick/tests.ts
index 4d0adf12..81113260 100644
--- a/challenges/pick/tests.ts
+++ b/challenges/pick/tests.ts
@@ -10,7 +10,7 @@ interface Pokemon {
}
const pickYourPokemon = (
- pokemon: Pick<Pokemon, 'name' | 'type'>
+ pokemon: MyPick<Pokemon, 'name' | 'type'>
) => {
const { type, name } = pokemon;
return `You picked the ${type}-type Pokemon ${name}!`
@@ -27,12 +27,12 @@ console.log(pickYourPokemon(pikachu))
/** Selecting an invalid property should be an error. */
const pokemonAttacks = (
// @ts-expect-error
- pokemon: Pick<Pokemon, 'attacks' | 'age'>
+ pokemon: MyPick<Pokemon, 'attacks' | 'age'>
) => {
return 'Oops! WE ';
}
/** It's also totally fine to select a single property */
-const recallPokemon = (pokemon: Pick<Pokemon, 'name'>) => {
+const recallPokemon = (pokemon: MyPick<Pokemon, 'name'>) => {
return `You recalled ${pokemon.name}!`
-}
\ No newline at end of file
+}
diff --git a/challenges/pick/user.ts b/challenges/pick/user.ts
index 29b2e6ba..3f591d64 100644
--- a/challenges/pick/user.ts
+++ b/challenges/pick/user.ts
@@ -1 +1 @@
-type Pick<T, K> = unknown;
\ No newline at end of file
+type MyPick<T, K> = unknown;