const fs = require('fs');

/**
 * @param {string} definitionLocation
 * @returns {Promise<*>}
 */
async function getFieldDefinition(definitionLocation) {
  try {
    return JSON.parse(fs.readFileSync(definitionLocation, 'utf-8'));
  } catch (e) {
    // ignore
  }

  return null;
}

module.exports = getFieldDefinition;
