mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
19 lines
479 B
TypeScript
19 lines
479 B
TypeScript
async function getCached({ p }) {
|
|
'use cache'
|
|
const array = await p
|
|
if (array instanceof Uint8Array) {
|
|
return array[0].toString(16) + '-' + Math.random()
|
|
}
|
|
return 'invalid'
|
|
}
|
|
|
|
export default async function Page({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<Record<string, string | string[] | undefined>>
|
|
}) {
|
|
const n = parseInt((await searchParams).n as any, 16)
|
|
const p = Promise.resolve(new Uint8Array([n]))
|
|
return <p id="x">{await getCached({ p })}</p>
|
|
}
|