UNPKG

blockstore-core

Version:

Contains various implementations of the API contract described in interface-blockstore

24 lines 700 B
import { NotFoundError } from 'interface-store'; import { BaseBlockstore } from './base.js'; export class BlackHoleBlockstore extends BaseBlockstore { put(key, value, options) { options?.signal?.throwIfAborted(); return key; } get(key, options) { options?.signal?.throwIfAborted(); throw new NotFoundError(); } has(key, options) { options?.signal?.throwIfAborted(); return false; } async delete(cid, options) { options?.signal?.throwIfAborted(); } // eslint-disable-next-line require-yield async *getAll(options) { options?.signal?.throwIfAborted(); } } //# sourceMappingURL=black-hole.js.map