EN

@core / cart

1.1.1 ▾
verifiedMIT
GitHub

Shopping cart: signed guest cookie, merge on login, server-side prices and a pluggable totals pipeline

Code10 filesContext~611 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/cart/adapters/hono.tsread-only · 69bfa3a
// Adaptador Hono: `app.route('/api/cart', cartRoutes({ currentUserId }))`.
import { Hono } from 'hono';
import { type CurrentUserId, cartHandlers } from './http.ts';

export function cartRoutes(opts: { currentUserId: CurrentUserId }) {
  const h = cartHandlers(opts.currentUserId);
  return new Hono()
    .get('/', (c) => h.get(c.req.raw))
    .post('/lines', (c) => h.add(c.req.raw))
    .put('/lines/:variantId', (c) => h.setQuantity(c.req.raw, c.req.param('variantId')))
    .put('/codes', (c) => h.setCodes(c.req.raw));
}

Report @core/cart

Sign in with GitHub to report a package.