import { toCamelCase } from './StringToCamelCase';
export function extractFieldValues(dto: any, keyStart: string) {
  for (const key in dto) {
    if (key.startsWith(keyStart)) {
      const value = dto[key]?.trim();
      if (!value) {
        throw new Error(`Value for column '${keyStart}' is blank`);
      }
      return toCamelCase(value);
    }
  }

  throw new Error(`column '${keyStart}' found missing in the file`);
}
