AndrewWalsh/at-your-service

View on GitHub
src/lib/samples-to-json-schema.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { createCompoundSchema, Schema } from "genson-js";

import type { Sample } from "../data-types";

export default function (samples: Array<Sample>): Schema {
  const mappedSamples = samples.map((s) => s.getSample());
  const converted = createCompoundSchema(mappedSamples);
  return converted;
}