'use strict';

const index = require('./index-16c91445.js');

function findFieldNestedField(fields, fieldId) {
  if (fieldId.includes('.')) {
    const nestedFieldId = fieldId.split('.')[0];
    return fields.find(field => field.id === nestedFieldId);
  }
  return undefined;
}
function findField(fields, fieldId) {
  if (fieldId === 'fullName') {
    return new index.TextField('fullName', '');
  }
  return fields.find(field => field.id === fieldId) || findFieldNestedField(fields, fieldId);
}

exports.findField = findField;
