<commit_before>import { MersenneTwister } from './randomizer/MersenneTwister';
import { app } from 'electron';

import * as path from 'path';

export class Utilities {
    static toPaddedHexString(num: number, len: number): string {
        const str = num.toString(16);
        return '0'.repeat(len - str.length) + str;
    }

    static getRandomInt(min: number, max: number, rng: MersenneTwister = new MersenneTwister()) {
      return Math.floor(rng.random() * (max - min + 1)) + min;
    }

    static isServe(): boolean {
      const args = process.argv.slice(1);
      return args.some(val => val === '--serve');
    }

    static getAppRoot() {
      const serve = this.isServe();

      if (serve) {
        return app.getAppPath();
      }

      if (process.platform === 'win32') {
        return path.join(app.getAppPath(), '../../');
      } else {
        return path.join(app.getAppPath(), '../../../../');
      }
    }
}<commit_msg>Fix getAppRoot() platform checking<commit_after>import { MersenneTwister } from './randomizer/MersenneTwister';
import { app } from 'electron';

import * as path from 'path';

export class Utilities {
    static toPaddedHexString(num: number, len: number): string {
        const str = num.toString(16);
        return '0'.repeat(len - str.length) + str;
    }

    static getRandomInt(min: number, max: number, rng: MersenneTwister = new MersenneTwister()) {
      return Math.floor(rng.random() * (max - min + 1)) + min;
    }

    static isServe(): boolean {
      const args = process.argv.slice(1);
      return args.some(val => val === '--serve');
    }

    static getAppRoot() {
      const serve = this.isServe();

      if (serve) {
        return app.getAppPath();
      }

      if (process.platform === 'darwin') {
        return path.join(app.getAppPath(), '../../../../');
      } else {
        return path.join(app.getAppPath(), '../../');
      }
    }
}
{'fraction_non_alphanumeric': 0.1675338189386056, 'fraction_numerical': 0.006243496357960458, 'mean_word_length': 2.421708185053381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '724033', 'n_tokens_mistral': 616, 'n_tokens_neox': 601, 'n_words': 145}