function getIdentifier(contents, migrationData) {
  const importMatch = contents.match(
    new RegExp(`\\s(\\S*)\\s+from\\s+['"]${migrationData.import}['"]`),
  );
  if (importMatch) return importMatch[1];
  const requireMatch = contents.match(
    new RegExp(`(\\S*)\\s+=\\s+require\\(['"]${migrationData.import}['"]\\)`),
  );
  if (requireMatch) return requireMatch[1];
  return migrationData.oldIdentifier;
}
Returns the identifier a given import is assigned to.
@param {string} contents The string contents of the file to migrate.
@param {MigrationData} migrationData Data defining what to migrate and how.
@returns {string} The identifier associated with the import associated with the
    migration data.