fix(core): update

This commit is contained in:
2019-09-16 13:19:42 +02:00
parent 80d6a5103a
commit d4f5d19231
5 changed files with 46 additions and 39 deletions

View File

@ -1,7 +1,7 @@
import * as plugins from './npmextra.plugins';
import * as paths from './npmextra.paths';
import { Task, TaskOnce } from '@pushrocks/taskbuffer';
import { Task } from '@pushrocks/taskbuffer';
export type TKeyValueStore = 'path' | 'gitProject' | 'custom';
@ -26,7 +26,7 @@ export class KeyValueStore {
}
this.deletedObject = {};
await plugins.smartfile.memory.toFs(JSON.stringify(this.dataObject), this.filePath);
},
}
});
/**
* computes the identity
@ -46,8 +46,7 @@ export class KeyValueStore {
plugins.smartfile.fs.ensureDirSync(paths.kvGitDir);
plugins.smartfile.fs.ensureDirSync(paths.kvPathDir);
plugins.smartfile.fs.ensureFileSync(this.filePath, '{}');
}
};
public type: TKeyValueStore; // the type of the kvStore
public identity: string; // the identity of the kvStore
@ -99,7 +98,7 @@ export class KeyValueStore {
* writes all keyValue pairs in the object argument
*/
public async writeAll(keyValueObject) {
this.dataObject = {...this.dataObject, ...keyValueObject};
this.dataObject = { ...this.dataObject, ...keyValueObject };
await this.syncTask.trigger();
}