Merge remote-tracking branch 'upstream/master'
commit
0294cf506b
|
@ -1,7 +1,6 @@
|
||||||
/* eslint-disable no-constant-condition */
|
/* eslint-disable no-constant-condition */
|
||||||
import { promises as fs, accessSync, constants, writeFileSync } from 'fs';
|
import { promises as fs, accessSync, constants, writeFileSync } from 'fs';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'util';
|
||||||
import { join } from 'path';
|
|
||||||
import { gzip, gzipSync, unzip } from 'zlib';
|
import { gzip, gzipSync, unzip } from 'zlib';
|
||||||
|
|
||||||
type JSONData = [{ key: string, value: any }?];
|
type JSONData = [{ key: string, value: any }?];
|
||||||
|
@ -19,7 +18,7 @@ export default class LocalStorage {
|
||||||
private locked: boolean = false;
|
private locked: boolean = false;
|
||||||
|
|
||||||
constructor(dbName: string, dir = `${__dirname}/../../localstorage`) {
|
constructor(dbName: string, dir = `${__dirname}/../../localstorage`) {
|
||||||
this.storagePath = join(__dirname, '../../localstorage') || dir;
|
this.storagePath = `${dir}/${dbName}.json.gz`;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue