// SPDX-License-Identifier: Apache-2.0
export class SimpleObjectStorageBackend {
    map;
    constructor(map) {
        this.map = map;
        if (!map) {
            throw new Error('Map is required');
        }
    }
    readObject(key) {
        return Promise.resolve(this.map.get(key));
    }
    writeObject(key, data) {
        this.map.set(key, data);
        return Promise.resolve();
    }
    list() {
        return Promise.resolve([...this.map.keys()]);
    }
    readBytes(key) {
        return Promise.resolve(Buffer.from(JSON.stringify(this.map.get(key))));
    }
    writeBytes(key, data) {
        this.map.set(key, JSON.parse(data.toString()));
        return Promise.resolve();
    }
    delete(key) {
        this.map.delete(key);
        return Promise.resolve();
    }
    isSupported(op) {
        return true;
    }
}
//# sourceMappingURL=simple-object-storage-backend.fixture.js.map