function check( links, db ) {
	var link;
	var out;
	var msg;
	var url;
	var id;
	var i;

	out = [];
	for ( i = 0; i < links.length; i++ ) {
		link = links[ i ];
		url = link.url;
		id = link.id;
		if ( !db[ url ] ) {
			if ( !idToUrl ) {
				createIdToUrl( db );
			}
			msg = 'Entry not found in database';
			if ( idToUrl[ id ] ) {
				msg += '. Did you mean to use URL `'+idToUrl[ id ]+'`?';
			}
			out.push({
				'error': msg,
				'id': id,
				'url': url
			});
		}
		else if ( db[ url ].id !== id ) {
			out.push({
				'error': 'Mismatched link identifier',
				'id': id,
				'url': url,
				'expected': db[ url ].id
			});
		}
	}
	return out;
}
Validates an array of link objects against a link database.

@private
@param {ObjectArray} links - array of link objects to validate
@param {Object} db - link database mapping link URLs to metadata
@returns {ObjectArray} array of validation errors