(filePath: string)
| 75 | }; |
| 76 | |
| 77 | export function assetContentType(filePath: string): string { |
| 78 | const ext = filePath.split(".").pop() ?? ""; |
| 79 | // Own-property check so an ext like "__proto__" can't resolve to Object.prototype. |
| 80 | const type = Object.hasOwn(ASSET_CONTENT_TYPES, ext) ? ASSET_CONTENT_TYPES[ext] : undefined; |
| 81 | return type ?? "application/octet-stream"; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Bind `server` to the first free port at or after `startPort` (scanning up to |