function addEtagInfo(res, collectionMetadata) {
	const data = res.locals.data;

	if (collectionMetadata) {
		var etags = (collectionMetadata[starkMetadata.ETAGS] = {});

		if (data instanceof Array) {
			for (var dataItem of data) {
				if (typeof dataItem.uuid !== "undefined") {
					etags[dataItem.uuid] = generateEtagValue(dataItem);
				}
			}
		}
	} else if (!(data instanceof Array) && typeof data === "object") {
		res.header(starkHttpHeader.ETAG, generateEtagValue(data));
	}
}
/**
 * In case the metadata object is passed, the "etags" object is added to it (Collection responses)
 * Otherwise the "etag" header is added to the response (single item responses)
 * @param res : The current request
 * @param collectionMetadata : Metadata object constructed by the Stark middleware (only for Collection responses)
 */
In case the metadata object is passed, the "etags" object is added to it (Collection responses)
Otherwise the "etag" header is added to the response (single item responses)
@param res : The current request
@param collectionMetadata : Metadata object constructed by the Stark middleware (only for Collection responses)
In case the metadata object is passed the " etags " object is added to it ( Collection responses ) Otherwise the " etag " header is added to the response ( single item responses ) @param res : The current request @param collectionMetadata : Metadata object constructed by the Stark middleware ( only for Collection responses )
function addEtagInfo(res, collectionMetadata) {
	const data = res.locals.data;
	if (collectionMetadata) {
		var etags = (collectionMetadata[starkMetadata.ETAGS] = {});
		if (data instanceof Array) {
			for (var dataItem of data) {
				if (typeof dataItem.uuid !== "undefined") {
					etags[dataItem.uuid] = generateEtagValue(dataItem);
				}
			}
		}
	} else if (!(data instanceof Array) && typeof data === "object") {
		res.header(starkHttpHeader.ETAG, generateEtagValue(data));
	}
}
function addEtagInfo ( res , collectionMetadata ) { const data = res . locals . data ; if ( collectionMetadata ) { var etags = ( collectionMetadata [ starkMetadata . ETAGS ] = { } ) ; if ( data instanceof Array ) { for ( var dataItem of data ) { if ( typeof dataItem . uuid !== "undefined" ) { etags [ dataItem . uuid ] = generateEtagValue ( dataItem ) ; } } } } else if ( ! ( data instanceof Array ) && typeof data === "object" ) { res . header ( starkHttpHeader . ETAG , generateEtagValue ( data ) ) ; } }
In case the metadata object is passed, the "etags" object is added to it (Collection responses)
 Otherwise the "etag" header is added to the response (single item responses)
 @param res : The current request
 @param collectionMetadata : Metadata object constructed by the Stark middleware (only for Collection responses)
In case the metadata object is passed the " etags " object is added to it ( Collection responses ) Otherwise the " etag " header is added to the response ( single item responses ) @param res : The current request @param collectionMetadata : Metadata object constructed by the Stark middleware ( only for Collection responses )