MCPcopy
hub / github.com/mailvelope/mailvelope / set

Method set

src/modules/keyring.js:65–76  ·  view source on GitHub ↗
(keyringId, attrMap)

Source from the content-addressed store, hash-verified

63 }
64
65 async set(keyringId, attrMap) {
66 if (!this.has(keyringId)) {
67 throw new Error(`Keyring does not exist for id: ${keyringId}`);
68 }
69 if (typeof attrMap !== 'object') {
70 throw new Error('KeyringAttrMap.set no attrMap provided');
71 }
72 const keyringAttr = super.get(keyringId) || {};
73 Object.assign(keyringAttr, attrMap);
74 super.set(keyringId, keyringAttr);
75 await this.store();
76 }
77
78 async store() {
79 await mvelo.storage.set('mvelo.keyring.attributes', this.toObject());

Callers 7

initMethod · 0.45
createMethod · 0.45
storeMethod · 0.45
firstTimeLoadFunction · 0.45
buildKeyringFunction · 0.45
sanitizeKeyringFunction · 0.45
setKeyringAttrFunction · 0.45

Calls 3

storeMethod · 0.95
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected