Add del() to ComposedStorage

This commit is contained in:
haad
2024-02-13 09:26:14 +01:00
parent 18eb27c44e
commit 3e93d294bf

View File

@@ -57,6 +57,18 @@ const ComposedStorage = async (storage1, storage2) => {
return value
}
/**
* Deletes a value from storage.
* @function
* @param {string} hash The hash of the value to delete.
* @memberof module:Storage.Storage-Composed
* @instance
*/
const del = async (hash) => {
await storage1.del(hash)
await storage2.del(hash)
}
/**
* Iterates over records stored in both storages.
* @function
@@ -115,6 +127,7 @@ const ComposedStorage = async (storage1, storage2) => {
return {
put,
get,
del,
iterator,
merge,
clear,