src/relayer/serializers/ManyResourceSerializer.js
import Serializer from "./Serializer.js";
import ResourceSerializer from "./ResourceSerializer.js";
import {Inject, factory} from "../injector.js";
export default class ManyResourceSerializer extends Serializer {
constructor(resourceSerializerFactory, resource) {
super(resource);
this.resourceSerializerFactory = resourceSerializerFactory;
}
serialize() {
return this.resource.map((resource) => this.resourceSerializerFactory(resource).serialize());
}
}
Inject(factory(ResourceSerializer))(ManyResourceSerializer);