import "dart:convert";

import "package:shared/generator.dart";

const corsHeaders = {
  "Access-Control-Allow-Origin": "*",
};

String encodeJsonList<T extends Encodable>(Iterable<T> data) {
  final jsonList = [
    for (final object in data)
      object.toJson(),
  ];
  return jsonEncode(jsonList);
}
