Download next.js/packages/next/src/shared/lib/router/utils/cache-busting-search-param.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/router/utils/cache-busting-search-param.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/shared/lib/router/utils/cache-busting-search-param.ts
-
curl -L -o cache-busting-search-param.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/shared/lib/router/utils/cache-busting-search-param.ts
648 Bytes
| import { hexHash } from '../../hash' | |
| export function computeCacheBustingSearchParam( | |
| prefetchHeader: string | string[] | undefined, | |
| segmentPrefetchHeader: string | string[] | undefined, | |
| stateTreeHeader: string | string[] | undefined, | |
| nextUrlHeader: string | string[] | undefined | |
| ): string { | |
| if ( | |
| prefetchHeader === undefined && | |
| segmentPrefetchHeader === undefined && | |
| stateTreeHeader === undefined && | |
| nextUrlHeader === undefined | |
| ) { | |
| return '' | |
| } | |
| return hexHash( | |
| [ | |
| prefetchHeader || '0', | |
| segmentPrefetchHeader || '0', | |
| stateTreeHeader || '0', | |
| nextUrlHeader || '0', | |
| ].join(',') | |
| ) | |
| } | |