diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 81873195..c9d55993 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -33,7 +33,7 @@ Set a default color, size, pet type, position, and theme when you open a Pet Pan * Pet Color: black, brown, green, yellow, gray, purple, red, white, orange * Pet Size: nano, small, medium, large -* Pet Type: cat, chicken, crab, clippy, cockatiel, dog, horse, mod, rocky, rubber duck, snake, totoro, turtle, zappy +* Pet Type: cat, chicken, crab, clippy, cockatiel, dog, horse, mod, rocky, rubber duck, snake, totoro, turtle, zappy, snail .. image:: _static/screenshot-2.gif :alt: Usage screenshot diff --git a/package.json b/package.json index 973c23bf..f11cf68e 100644 --- a/package.json +++ b/package.json @@ -194,7 +194,8 @@ "snake", "totoro", "turtle", - "zappy" + "zappy", + "snail" ], "default": "cat", "description": "Pet type", diff --git a/src/extension/extension.ts b/src/extension/extension.ts index 56280b80..47ef496a 100644 --- a/src/extension/extension.ts +++ b/src/extension/extension.ts @@ -817,7 +817,7 @@ class PetWebviewContainer implements IPetPanel { command: 'delete-pet', name: petName, type: petType, - color: petColor + color: petColor, }); } @@ -1000,7 +1000,7 @@ class PetPanel extends PetWebviewContainer implements IPetPanel { command: 'delete-pet', name: petName, type: petType, - color: petColor + color: petColor, }); } diff --git a/src/panel/main.ts b/src/panel/main.ts index a71a87db..aaa6baf9 100644 --- a/src/panel/main.ts +++ b/src/panel/main.ts @@ -573,7 +573,11 @@ export function petPanelApp( }); }); case 'delete-pet': - var pet = allPets.locatePet(message.name, message.type, message.color); + var pet = allPets.locatePet( + message.name, + message.type, + message.color, + ); if (pet) { allPets.remove(pet); saveState(stateApi); diff --git a/src/panel/pets.ts b/src/panel/pets.ts index 428860a4..e6d2a851 100644 --- a/src/panel/pets.ts +++ b/src/panel/pets.ts @@ -57,7 +57,11 @@ export interface IPetCollection { reset(): void; seekNewFriends(): string[]; locate(name: string): PetElement | undefined; - locatePet(name: string, type: string, color: string): PetElement | undefined; + locatePet( + name: string, + type: string, + color: string, + ): PetElement | undefined; remove(pet: PetElement): void; } @@ -89,9 +93,17 @@ export class PetCollection implements IPetCollection { }); } - locatePet(name: string, type: string, color: string): PetElement | undefined { + locatePet( + name: string, + type: string, + color: string, + ): PetElement | undefined { return this._pets.find((collection) => { - return collection.pet.name === name && collection.type === type && collection.color === color; + return ( + collection.pet.name === name && + collection.type === type && + collection.color === color + ); }); } diff --git a/src/test/suite/panel.test.ts b/src/test/suite/panel.test.ts index 53f551dc..d635c348 100644 --- a/src/test/suite/panel.test.ts +++ b/src/test/suite/panel.test.ts @@ -113,7 +113,7 @@ suite('Pets Test Suite', () => { collection.push(testPetElement); assert.strictEqual(collection.locate('Jerry'), testPetElement); - collection.remove('Jerry'); + collection.remove(testPetElement); assert.strictEqual(collection.locate('Jerry'), undefined); });