function fixImport(contents, migrationData) {
  const identifier = getIdentifier(contents, migrationData);
  // Don't need to run if there are no references.
  if (!identifier) return contents;
  // If the identifier changed, update all references to it and the import
  if (migrationData.oldIdentifier !== migrationData.newIdentifier) {
    const newContents = replaceReferences(contents, migrationData, identifier);
    if (newContents !== contents) {
      return addImport(newContents, migrationData);
    }
  } else {
    // Just the import changed
    return addImport(contents, migrationData);
  }
  return contents;
}
Migrates a particular import in a particular file. Renames references to
where the import used to exist on the namespace tree, and adds/updates
imports.
@param {string} contents The string contents of the file to migrate.
@param {MigrationData} migrationData Data defining what to migrate and how.
@returns {string} The migrated contents of the file.