All files / src/sections acknowledgements.ts

100% Statements 27/27
100% Branches 5/5
100% Functions 3/3
100% Lines 27/27

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 26 27 281x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 1x 1x 3x 3x 1x 1x 1x 4x 4x  
import { ListOptions, ListSection } from './list-section.js';
import { link } from '../elements/link.js';
 
interface Link {
  text: string;
  url: string;
}
 
export interface AcknowledgementOptions extends Partial<ListOptions<Link>> {}
 
export class Acknowledgements extends ListSection<Link> {
  constructor(options?: AcknowledgementOptions) {
    super({
      title: options?.title ?? 'Acknowledgements',
      type: 'Unordered',
      ...options,
    });
  }
 
  protected itemMapper({ text, url }: Link): string {
    return link(text, url);
  }
}
 
export function acknowledgementsSection(options?: AcknowledgementOptions) {
  return new Acknowledgements(options);
}