fix: example app uses deterministic ID generation; trim dead exports
- Fix examples/app/src/routes/users.ts to use crypto hash instead of Date.now() - Remove unused renderProgress export from human.ts - Remove unused formatTripleBoundaryCounterexample from triple-boundary-testing.ts - Remove unused clearCapturedRoutes from discovery.ts - Remove dead BUILTIN_PLUGIN_CONTRACTS constant - Build: clean | Tests: 847 pass, 2 fail (pre-existing flaky --changed tests)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import crypto from 'crypto'
|
||||
import type { FastifyInstance } from 'fastify'
|
||||
|
||||
export async function userRoutes(fastify: FastifyInstance) {
|
||||
@@ -30,7 +31,7 @@ export async function userRoutes(fastify: FastifyInstance) {
|
||||
},
|
||||
}, async (req, reply) => {
|
||||
const { name, email } = req.body as { name: string; email: string }
|
||||
const id = `user-${Date.now()}`
|
||||
const id = `user-${crypto.createHash('sha256').update(email).digest('hex').slice(0, 8)}`
|
||||
const user = { id, name, email }
|
||||
fastify.db.users.set(id, user)
|
||||
reply.status(201)
|
||||
|
||||
Reference in New Issue
Block a user