Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Dexie from 'dexie';
import {ok, start, asyncTest} from 'QUnit';
Dexie.debug = window.location.search.indexOf('longstacks=true') !== -1 ? 'dexie' : false;
if (window.location.search.indexOf('longstacks=tests') !== -1) Dexie.debug = true; // Don't include stuff from dexie.js.
var no_optimize = window.no_optimize || window.location.search.indexOf('dontoptimize=true') !== -1;
export function resetDatabase(db) {
///
var Promise = Dexie.Promise;
return no_optimize || !db._hasBeenCreated ?
// Full Database recreation. Takes much time!
db.delete().then(function () {
return db.open().then(function() {
if (!no_optimize) {
db._hasBeenCreated = true;
var initialState = (db._initialState = {});
// Now, snapshot the database how it looks like initially (what on.populate did)
return db.transaction('r', db.tables, function() {
var trans = Dexie.currentTransaction;
import Dexie from 'dexie';
import {ok, start, asyncTest} from 'QUnit';
Dexie.debug = window.location.search.indexOf('longstacks=true') !== -1 ? 'dexie' : false;
if (window.location.search.indexOf('longstacks=tests') !== -1) Dexie.debug = true; // Don't include stuff from dexie.js.
var no_optimize = window.no_optimize || window.location.search.indexOf('dontoptimize=true') !== -1;
export function resetDatabase(db) {
///
var Promise = Dexie.Promise;
return no_optimize || !db._hasBeenCreated ?
// Full Database recreation. Takes much time!
db.delete().then(function () {
return db.open().then(function() {
if (!no_optimize) {
db._hasBeenCreated = true;
var initialState = (db._initialState = {});
// Now, snapshot the database how it looks like initially (what on.populate did)
return db.transaction('r', db.tables, function() {
import Dexie from 'dexie';
import log from 'electron-log';
// import FileObject from './fileObject';
// Force debug mode to get async stacks from exceptions.
if (process.env.NODE_ENV === 'production') {
Dexie.debug = false;
} else {
Dexie.debug = true; // In production, set to false to increase performance a little.
}
const imageDB = new Dexie('ImageDatabase');
imageDB.version(1).stores({
frameList: '&frameId, fileId, frameNumber, [fileId+frameNumber]',
// fileScanList: '&fileId',
});
const FileObject = imageDB.frameList.defineClass({
frameId: String,
fileId: String,
frameNumber: Number,
data: Blob
});
import Dexie from 'dexie';
import 'dexie-observable';
import uuidv4 from 'uuid/v4';
import { APP_ID } from './constants';
if (process.env.NODE_ENV !== 'production') {
// If not in production mode, turn Dexie's debug mode on.
Dexie.debug = true;
}
// A UUID to distinguish this JS client from others in the same browser.
export const CLIENTID = uuidv4();
const db = new Dexie(APP_ID);
export default db;
export const { Collection } = db;
var Data = require('modules/data');
var Subsystems = require('modules/subsystem');
var convert = require('modules/convert');
var jsonfile = require('jsonfile');
var $ = require('jquery');
var async = require('async');
var Dexie = require('dexie');
Dexie.debug = false;
var files = {
1: [
"replays1430861081332.txt"
]
};
function get_replays(version) {
console.log("Getting version " + version + " replays.");
return new Promise(function (resolve, reject) {
async.map(files[version], function (path, callback) {
$.ajax({
url: "/fixtures/replays_" + version + "/" + path,
dataType: "text"
}).done(function (data) {
callback(null, {
name: path,