MCPcopy
hub / github.com/jmcdo29/testing-nestjs / deleteCat

Method deleteCat

apps/complex-sample/src/cat/cat.service.ts:36–43  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

34 }
35
36 deleteCat(id: number): boolean {
37 const index = this.cats.findIndex((cat) => cat.id === id);
38 if (index === -1) {
39 return false;
40 }
41 this.cats = this.cats.filter((cat, catIndex) => catIndex !== index);
42 return true;
43 }
44}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected