Download next.js/packages/next/src/server/normalizers/request/prefetch-rsc.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 708 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.ts
-
curl -L -o prefetch-rsc.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/server/normalizers/request/prefetch-rsc.ts
708 Bytes
| import type { PathnameNormalizer } from './pathname-normalizer' | |
| import { RSC_PREFETCH_SUFFIX } from '../../../lib/constants' | |
| import { SuffixPathnameNormalizer } from './suffix' | |
| export class PrefetchRSCPathnameNormalizer | |
| extends SuffixPathnameNormalizer | |
| implements PathnameNormalizer | |
| { | |
| constructor() { | |
| super(RSC_PREFETCH_SUFFIX) | |
| } | |
| public match(pathname: string): boolean { | |
| if (pathname === '/__index' + RSC_PREFETCH_SUFFIX) { | |
| return true | |
| } | |
| return super.match(pathname) | |
| } | |
| public normalize(pathname: string, matched?: boolean): string { | |
| if (pathname === '/__index' + RSC_PREFETCH_SUFFIX) { | |
| return '/' | |
| } | |
| return super.normalize(pathname, matched) | |
| } | |
| } | |