Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const target = config.dids[did] = config.dids[did] || {};
if(options.add) {
if(options.add[0] === 'id' || options.add[0] === '@id') {
throw new Error('Can not add "id"');
}
jsonld.addValue(
target, options.add[0], options.add[1], {allowDuplicate: false});
store = true;
}
if(options.remove) {
if(options.remove[0] === 'id' || options.remove[0] === '@id') {
throw new Error('Can not remove "id"');
}
jsonld.removeValue(target, options.remove[0], options.remove[1]);
store = true;
}
if(options.get) {
if(options.get in target) {
_showNote(did, target, options.get, options);
}
}
if(options.set) {
if(options.set[0] === 'id' || options.set[0] === '@id') {
throw new Error('Can not set "id"');
}
target[options.set[0]] = options.set[1];
store = true;
}
if(options.delete) {
delete target[options.delete];