Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var path = require('path');
var settings = require('./settings');
var fs = require('fs-extra');
var fileUrl = require('file-url');
var electron = require('electron');
var BrowserWindow = electron.BrowserWindow;
var turf = require('@turf/turf');
var Tin = require('../common/js/tin');
var wkt = require('wellknown');
var isClockwise = turf.booleanClockwise;
const {ipcMain} = require('electron');
var internal = require('mapshaper').internal;
settings.init();
var mapFolder;
var tileFolder;
var focused;
var tinObject;
var mapedit = {
init: function() {
var saveFolder = settings.getSetting('saveFolder');
mapFolder = saveFolder + path.sep + 'maps';
fs.ensureDir(mapFolder, function(err) {});
tileFolder = saveFolder + path.sep + 'tiles';
fs.ensureDir(tileFolder, function(err) {});
focused = BrowserWindow.getFocusedWindow();
return new Promise((resolve, reject) => {
mapshaper.runCommands(command, (error) => {
if(error){reject(error);};
resolve();
});
});
}