Initial commit: Vuelato - buscador de vuelos
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Nuxt 4 + Supabase + Flightics API. Incluye búsqueda de vuelos, inspiraciones, watchlist, tracking de precios y mapa interactivo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
server/utils/search-hash.ts
Normal file
16
server/utils/search-hash.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { hash as ohash } from 'ohash'
|
||||
|
||||
/**
|
||||
* Genera un hash determinista de los parametros de busqueda.
|
||||
* Normaliza el objeto: ordena keys recursivamente y elimina campos
|
||||
* irrelevantes (_poll, maxResults) para que busquedas equivalentes
|
||||
* produzcan el mismo hash.
|
||||
*/
|
||||
export function computeSearchHash(params: Record<string, unknown>): string {
|
||||
const normalized = { ...params }
|
||||
// Campos que no afectan los resultados de la busqueda
|
||||
delete normalized._poll
|
||||
delete normalized.maxResults
|
||||
|
||||
return ohash(normalized)
|
||||
}
|
||||
Reference in New Issue
Block a user