mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
15 lines
311 B
TypeScript
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`)}`;
|
|
}
|