fix(core): update
This commit is contained in:
@ -21,12 +21,11 @@ export class KeyValueStore {
|
||||
bufferMax: 2,
|
||||
execDelay: 500,
|
||||
taskFunction: async () => {
|
||||
this.dataObject = plugins.smartlodash.merge(
|
||||
{},
|
||||
plugins.smartfile.fs.toObjectSync(this.filePath),
|
||||
this.dataObject
|
||||
);
|
||||
for (let key in this.deletedObject) {
|
||||
this.dataObject = {
|
||||
...plugins.smartfile.fs.toObjectSync(this.filePath),
|
||||
...this.dataObject
|
||||
};
|
||||
for (const key of Object.keys(this.deletedObject)) {
|
||||
delete this.dataObject[key];
|
||||
}
|
||||
this.deletedObject = {};
|
||||
@ -79,15 +78,15 @@ export class KeyValueStore {
|
||||
/**
|
||||
* writes all keyValue pairs in the object argument
|
||||
*/
|
||||
async writeAll(keyValueObject) {
|
||||
plugins.smartlodash.merge(this.dataObject, keyValueObject);
|
||||
public async writeAll(keyValueObject) {
|
||||
this.dataObject = {...this.dataObject, ...keyValueObject};
|
||||
this.syncTask.trigger();
|
||||
}
|
||||
|
||||
/**
|
||||
* wipes a key value store from disk
|
||||
*/
|
||||
async wipe() {
|
||||
public async wipe() {
|
||||
for (let key in this.dataObject) {
|
||||
this.deletedObject[key] = this.dataObject[key];
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ export class Npmextra {
|
||||
} else {
|
||||
npmextraToolOptions = {};
|
||||
}
|
||||
let mergedOptions = plugins.smartlodash.merge({}, defaultOptionsArg, npmextraToolOptions);
|
||||
let mergedOptions = {
|
||||
...defaultOptionsArg,
|
||||
...npmextraToolOptions
|
||||
};
|
||||
return mergedOptions;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import * as beautylog from '@pushrocks/smartlog';
|
||||
import * as path from 'path';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import smartlodash from 'smartlodash';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||
|
||||
export { beautylog, path, smartfile, smartpath, smartpromise, smartlodash, taskbuffer };
|
||||
export { beautylog, path, smartfile, smartpath, smartpromise, taskbuffer };
|
||||
|
Reference in New Issue
Block a user