Download next.js/packages/next/src/client/components/hooks-server-context.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 539 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/hooks-server-context.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/client/components/hooks-server-context.ts
-
curl -L -o hooks-server-context.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/hooks-server-context.ts
539 Bytes
| const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE' | |
| export class DynamicServerError extends Error { | |
| digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE | |
| constructor(public readonly description: string) { | |
| super(`Dynamic server usage: ${description}`) | |
| } | |
| } | |
| export function isDynamicServerError(err: unknown): err is DynamicServerError { | |
| if ( | |
| typeof err !== 'object' || | |
| err === null || | |
| !('digest' in err) || | |
| typeof err.digest !== 'string' | |
| ) { | |
| return false | |
| } | |
| return err.digest === DYNAMIC_ERROR_CODE | |
| } | |