function collectExistingLinks( node ) {
	var existingLinks = {};
	visit( node, 'definition', onDefinition );
	return existingLinks;

	/**
	* Callback invoked upon encountering a link definition.
	*
	* @private
	* @param {Node} definition - reference node
	* @returns {void}
	*/
	function onDefinition( definition ) {
		var identifier = definition.identifier;
		existingLinks[ identifier ] = true;
	}
}
Collects existing link definitions into an object.

@private
@param {Node} node - reference node
@returns {Object} object mapping link identifiers to `true`