Compare commits

..

4 Commits

Author SHA1 Message Date
82af55fae9 3.0.5 2019-05-10 17:07:26 +02:00
90f8ee4e9d fix(core): update 2019-05-10 17:07:25 +02:00
4fe85134c4 3.0.4 2019-05-10 17:05:04 +02:00
c307b7c7b0 fix(core): update 2019-05-10 17:05:04 +02:00
3 changed files with 12 additions and 12 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/npmextra", "name": "@pushrocks/npmextra",
"version": "3.0.3", "version": "3.0.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/npmextra", "name": "@pushrocks/npmextra",
"version": "3.0.3", "version": "3.0.5",
"private": false, "private": false,
"description": "do more with npm", "description": "do more with npm",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -9,14 +9,14 @@ export type TKeyValueStore = 'path' | 'gitProject' | 'custom';
* kvStore is a simple key vlaue store to store data about projects between runs * kvStore is a simple key vlaue store to store data about projects between runs
*/ */
export class KeyValueStore { export class KeyValueStore {
dataObject: any; public dataObject: any;
deletedObject: any = {}; public deletedObject: any = {};
initialReadTask = new TaskOnce({ public initialReadTask = new TaskOnce({
taskFunction: async () => { taskFunction: async () => {
this.dataObject = plugins.smartfile.fs.toObjectSync(this.filePath); this.dataObject = plugins.smartfile.fs.toObjectSync(this.filePath);
} }
}); });
syncTask = new Task({ public syncTask = new Task({
buffered: true, buffered: true,
bufferMax: 2, bufferMax: 2,
execDelay: 500, execDelay: 500,
@ -33,9 +33,9 @@ export class KeyValueStore {
}, },
name: 'syncTask' name: 'syncTask'
}); });
type: TKeyValueStore; // the type of the kvStore public type: TKeyValueStore; // the type of the kvStore
identity: string; // the identity of the kvStore public identity: string; // the identity of the kvStore
filePath: string; // the filePath of the kvStore public filePath: string; // the filePath of the kvStore
/** /**
* the constructor of keyvalue store * the constructor of keyvalue store
@ -52,7 +52,7 @@ export class KeyValueStore {
/** /**
* reads all keyValue pairs at once and returns them * reads all keyValue pairs at once and returns them
*/ */
async readAll() { public async readAll() {
await this.initialReadTask.trigger(); await this.initialReadTask.trigger();
this.syncTask.trigger(); this.syncTask.trigger();
return this.dataObject; return this.dataObject;
@ -61,7 +61,7 @@ export class KeyValueStore {
/** /**
* reads a keyValueFile from disk * reads a keyValueFile from disk
*/ */
async readKey(keyArg: string) { public async readKey(keyArg: string) {
let data = await this.readAll(); let data = await this.readAll();
return data[keyArg]; return data[keyArg];
} }
@ -95,7 +95,7 @@ export class KeyValueStore {
/** /**
* updates a value * updates a value
*/ */
async update(keyObject) {} public async update(keyObject) {}
/** /**
* computes the identity * computes the identity