<commit_before>import { mod } from '../Astro';
import { egyptian } from '../Const';
import { CalendarValidationException, YearMonthCalendar } from '../Calendar';

export class EgyptianCalendar extends YearMonthCalendar {
  constructor(jdn: number, year: number, month: number, day: number) {
    super(jdn, year, month, day);
  }

  // Determine Julian day number from Egyptian calendar date
  public static toJdn(year: number, month: number, day: number): number {
    this.validate(year, month, day);

    return egyptian.EPOCH + 365 * (year - 1) + 30 * (month - 1) + day - 1.0;
  }

  // Calculate Egyptian calendar date from Julian day
  public static fromJdn(jdn: number): EgyptianCalendar {
    const days: number = jdn - egyptian.EPOCH;
    const year: number = Math.floor(days / 365) + 1;
    const month: number = Math.floor(mod(days, 365) / 30) + 1;
    const day: number = days - 365 * (year - 1) - 30 * (month - 1) + 1;

    return new EgyptianCalendar(jdn, year, month, day);
  }

  public static validate(year: number, month: number, day: number): void {
    if (month < 1 || month > 13) {
      throw new CalendarValidationException('Invalid month');
    }

    if (month === 13 && day > 5) {
      throw new CalendarValidationException('Invalid day');
    }

    if (day < 1 || day > 30) {
      throw new CalendarValidationException('Invalid day');
    }
  }
}<commit_msg>Corrected source code of src/calendar/EgyptianCalendar.ts to follow tslint stricter mode.<commit_after>import { mod } from '../Astro';
import { egyptian } from '../Const';
import { CalendarValidationException, YearMonthCalendar } from '../Calendar';

export class EgyptianCalendar extends YearMonthCalendar {
  // Determine Julian day number from Egyptian calendar date
  public static toJdn(year: number, month: number, day: number): number {
    this.validate(year, month, day);

    return egyptian.EPOCH + 365 * (year - 1) + 30 * (month - 1) + day - 1.0;
  }

  // Calculate Egyptian calendar date from Julian day
  public static fromJdn(jdn: number): EgyptianCalendar {
    const days: number = jdn - egyptian.EPOCH;
    const year: number = Math.floor(days / 365) + 1;
    const month: number = Math.floor(mod(days, 365) / 30) + 1;
    const day: number = days - 365 * (year - 1) - 30 * (month - 1) + 1;

    return new EgyptianCalendar(jdn, year, month, day);
  }

  public static validate(year: number, month: number, day: number): void {
    if (month < 1 || month > 13) {
      throw new CalendarValidationException('Invalid month');
    }

    if (month === 13 && day > 5) {
      throw new CalendarValidationException('Invalid day');
    }

    if (day < 1 || day > 30) {
      throw new CalendarValidationException('Invalid day');
    }
  }

  constructor(jdn: number, year: number, month: number, day: number) {
    super(jdn, year, month, day);
  }
}
{'fraction_non_alphanumeric': 0.1296426068675543, 'fraction_numerical': 0.025227750525578137, 'mean_word_length': 3.235905044510386, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5264844', 'n_tokens_mistral': 944, 'n_tokens_neox': 841, 'n_words': 295}