function normalizeRelatedNodes(node, options) {
	'use strict';
	['any', 'all', 'none'].forEach(type => {
		if (!Array.isArray(node[type])) {
			return;
		}
		node[type]
			.filter(checkRes => Array.isArray(checkRes.relatedNodes))
			.forEach(checkRes => {
				checkRes.relatedNodes = checkRes.relatedNodes.map(relatedNode => {
					var res = {
						html: relatedNode.source
					};
					if (options.elementRef && !relatedNode.fromFrame) {
						res.element = relatedNode.element;
					}
					if (options.selectors !== false || relatedNode.fromFrame) {
						res.target = relatedNode.selector;
					}
					if (options.xpath) {
						res.xpath = relatedNode.xpath;
					}
					return res;
				});
			});
	});
}
function normalizeRelatedNodes(node, options) {
	'use strict';
	['any', 'all', 'none'].forEach(type => {
		if (!Array.isArray(node[type])) {
			return;
		}
		node[type]
			.filter(checkRes => Array.isArray(checkRes.relatedNodes))
			.forEach(checkRes => {
				checkRes.relatedNodes = checkRes.relatedNodes.map(relatedNode => {
					var res = {
						html: relatedNode.source
					};
					if (options.elementRef && !relatedNode.fromFrame) {
						res.element = relatedNode.element;
					}
					if (options.selectors !== false || relatedNode.fromFrame) {
						res.target = relatedNode.selector;
					}
					if (options.xpath) {
						res.xpath = relatedNode.xpath;
					}
					return res;
				});
			});
	});
}
function normalizeRelatedNodes ( node , options ) { 'use strict' ; [ 'any' , 'all' , 'none' ] . forEach ( type => { if ( ! Array . isArray ( node [ type ] ) ) { return ; } node [ type ] . filter ( checkRes => Array . isArray ( checkRes . relatedNodes ) ) . forEach ( checkRes => { checkRes . relatedNodes = checkRes . relatedNodes . map ( relatedNode => { var res = { html : relatedNode . source } ; if ( options . elementRef && ! relatedNode . fromFrame ) { res . element = relatedNode . element ; } if ( options . selectors !== false || relatedNode . fromFrame ) { res . target = relatedNode . selector ; } if ( options . xpath ) { res . xpath = relatedNode . xpath ; } return res ; } ) ; } ) ; } ) ; }
/*global helpers
/ * global helpers
Normalize related nodes