@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
36 lines • 1.08 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractStore_1 = __importDefault(require("./AbstractStore"));
class AbstractLocalStore extends AbstractStore_1.default {
constructor(options) {
super(options);
}
get settings() {
return this.Service('settings');
}
writeValue(key, value) {
this.writeValues({ [key]: value });
return;
}
writeValues(values) {
const settings = { ...this.readSettings(), ...values };
this.settings.set('stores', settings);
return this;
}
readValue(key) {
const settings = this.readValues();
return settings[key];
}
readValues() {
const values = this.readSettings();
return values;
}
readSettings() {
return this.settings.get('stores') ?? {};
}
}
exports.default = AbstractLocalStore;
//# sourceMappingURL=AbstractLocalStore.js.map
;