react-code-dataset / next.js /packages /next /src /client /components /router-reducer /create-router-cache-key.test.ts
Download next.js/packages/next/src/client/components/router-reducer/create-router-cache-key.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/router-reducer/create-router-cache-key.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/client/components/router-reducer/create-router-cache-key.test.ts
-
curl -L -o create-router-cache-key.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/components/router-reducer/create-router-cache-key.test.ts
544 Bytes
| import { createRouterCacheKey } from './create-router-cache-key' | |
| describe('createRouterCacheKey', () => { | |
| it('should support string segment', () => { | |
| expect(createRouterCacheKey('foo')).toEqual('foo') | |
| }) | |
| it('should support dynamic segment', () => { | |
| expect(createRouterCacheKey(['slug', 'hello-world', 'd'])).toEqual( | |
| 'slug|hello-world|d' | |
| ) | |
| }) | |
| it('should support catch all segment', () => { | |
| expect(createRouterCacheKey(['slug', 'blog/hello-world', 'c'])).toEqual( | |
| 'slug|blog/hello-world|c' | |
| ) | |
| }) | |
| }) | |