All files / scripts/generate-news-indexes/template constants.ts

100% Statements 4/4
50% Branches 1/2
100% Functions 1/1
100% Lines 4/4

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                  6x     6x       33x 33x    
/**
 * @module generate-news-indexes/template/constants
 * @description Constants shared by news-index template modules.
 *
 * @author Hack23 AB
 * @license Apache-2.0
 */
 
/** Default app version when `npm_package_version` is not set. */
export const APP_VERSION_FALLBACK = '0.0.0';
 
/** Canonical absolute base URL used in JSON-LD blocks. */
export const BASE_URL = 'https://riksdagsmonitor.com';
 
/** Single source of truth for the app-version marker in the rendered HTML. */
export function appVersionMarker(): string {
  const version = (process.env.npm_package_version ?? APP_VERSION_FALLBACK).trim();
  return `<!-- app-version: v${version} -->`;
}