function findBookInCart()

in src/mutators/cart/books.ts [5:16]


function findBookInCart(bookId: string) {
    const store = getStore();
    let foundIndex: number | null = null;
    for (let index = 0; index < store.cart.books.length; index++) {
        let item = store.cart.books[index];
        if (item.bookId == bookId) {
            foundIndex = index;
            break;
        }
    }
    return foundIndex;
}