<commit_before>import { BrowserWindow } from 'electron';

export default () => {

}

function checkBounds(bounds) {
    // check if the browser window is offscreen
    const display = electron.screen.getDisplayNearestPoint(bounds).workArea;

    const onScreen = bounds.x >= display.x
        && bounds.x + bounds.width <= display.x + display.width
        && bounds.y >= display.y
        && bounds.y + bounds.height <= display.y + display.height;

    if (!onScreen) {
        delete bounds.x;
        delete bounds.y;
        bounds.width = 900;
        bounds.height = 550;
    }

    return bounds;
}<commit_msg>Fixed git screwup<commit_after>import { BrowserWindow } from 'electron';
import os from 'os';

export default (icons, config, srcPath) => {
  const bounds = checkBounds(config.bounds);

  const mainWindowOption = {
        title     : 'Museeks',
        icon      :  os.platform() === 'win32' ? icons['ico'] : icons['256'],
        x         :  bounds.x,
        y         :  bounds.y,
        width     :  bounds.width,
        height    :  bounds.height,
        minWidth  :  900,
        minHeight :  550,
        frame     :  config.useNativeFrame,
        show      :  false
    };

    // Create the browser window
    const mainWindow = new BrowserWindow(mainWindowOption);

    // ... and load our html page
    mainWindow.loadURL(`file://${srcPath}/app.html#/library`);

    mainWindow.on('closed', () => {
        // Dereference the window object
        mainWindow = null;
    });
    mainWindow.on('ready-to-show', () => {
        mainWindow.show();
    });
    mainWindow.on('close', (e) => {
        e.preventDefault();
        mainWindow.webContents.send('close');
    });

  return mainWindow
}

function checkBounds(bounds) {
    // check if the browser window is offscreen
    const display = electron.screen.getDisplayNearestPoint(bounds).workArea;

    const onScreen = bounds.x >= display.x
        && bounds.x + bounds.width <= display.x + display.width
        && bounds.y >= display.y
        && bounds.y + bounds.height <= display.y + display.height;

    if (!onScreen) {
        delete bounds.x;
        delete bounds.y;
        bounds.width = 900;
        bounds.height = 550;
    }

    return bounds;
}
{'fraction_non_alphanumeric': 0.13116940862605603, 'fraction_numerical': 0.010226767452200978, 'mean_word_length': 2.1779661016949152, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '2350912', 'n_tokens_mistral': 686, 'n_tokens_neox': 648, 'n_words': 154}