(relativePath: string)
| 103 | } |
| 104 | |
| 105 | function assertSafeRelativePath(relativePath: string): void { |
| 106 | if ( |
| 107 | relativePath.length === 0 || |
| 108 | relativePath.startsWith('/') || |
| 109 | relativePath.includes('\\') || |
| 110 | relativePath.split('/').includes('..') || |
| 111 | /^[A-Za-z]:/.test(relativePath) |
| 112 | ) { |
| 113 | throw new Error(`Invalid web asset relative path: ${relativePath}`); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | export function webAssetManifestKey(target: string = currentTarget()): string { |
| 118 | return buildWebManifestKey(target); |
no outgoing calls
no test coverage detected