All files / skin-lr2/src special-graphic.ts

100% Statements 2/2
100% Branches 6/6
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25      57x                       24x                  
/**
 * Sentinel paths used in `LR2ImageRect.imagePath` for LR2's runtime-bound textures (`#SRC_IMAGE,gr=...`).
 */
export const LR2_SPECIAL_GRAPHIC = {
  STAGEFILE: '__lr2_special:stagefile',
  BACKBMP: '__lr2_special:backbmp',
  BANNER: '__lr2_special:banner',
  SKIN_THUMBNAIL: '__lr2_special:skin_thumbnail',
  BLACK: '__lr2_special:black',
  WHITE: '__lr2_special:white',
} as const;
 
export type LR2SpecialGraphic = (typeof LR2_SPECIAL_GRAPHIC)[keyof typeof LR2_SPECIAL_GRAPHIC];
 
export function isLR2SpecialGraphic(path: string): path is LR2SpecialGraphic {
  return (
    path === LR2_SPECIAL_GRAPHIC.STAGEFILE ||
    path === LR2_SPECIAL_GRAPHIC.BACKBMP ||
    path === LR2_SPECIAL_GRAPHIC.BANNER ||
    path === LR2_SPECIAL_GRAPHIC.SKIN_THUMBNAIL ||
    path === LR2_SPECIAL_GRAPHIC.BLACK ||
    path === LR2_SPECIAL_GRAPHIC.WHITE
  );
}