Files
pixel.horse/src/ts/client/rev.ts
T
2026-08-06 08:50:21 +02:00

15 lines
311 B
TypeScript

import { REV } from '../generated/rev';
/* istanbul ignore next */
export function getUrl(name: string): string {
if (DEVELOPMENT) {
return `/assets/${name}`;
}
if (!REV[name]) {
throw new Error(`Cannot find file url (${name})`);
}
return `/assets/${name.replace(/(\.\S+)$/, `-${REV[name]}$1`)}`;
}