Buckets:
| /** | |
| * `app` -> app dir | |
| * `pages` -> pages dir | |
| * `root` -> middleware / instrumentation | |
| * `assets` -> assets | |
| */ | |
| export type EntryKeyType = 'app' | 'pages' | 'root' | 'assets' | |
| export type EntryKeySide = 'client' | 'server' | |
| // custom type to make sure you can't accidentally use a "generic" string | |
| export type EntryKey = | |
| `{"type":"${EntryKeyType}","side":"${EntryKeyType}","page":"${string}"}` | |
| /** | |
| * Get a key that's unique across all entrypoints. | |
| */ | |
| export function getEntryKey( | |
| type: EntryKeyType, | |
| side: EntryKeySide, | |
| page: string | |
| ): EntryKey { | |
| return JSON.stringify({ type, side, page }) as EntryKey | |
| } | |
| /** | |
| * Split an `EntryKey` up into its components. | |
| */ | |
| export function splitEntryKey(key: EntryKey): { | |
| type: EntryKeyType | |
| side: EntryKeySide | |
| page: string | |
| } { | |
| return JSON.parse(key) | |
| } | |
Xet Storage Details
- Size:
- 813 Bytes
- Xet hash:
- 0bd8ad74e6fbc3fcff1f15aadc437cf6af6ddd3ce7bfd558da77c0d8f1bbe5a6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.