<commit_before>require("prebid-universal-creative");

window.PWT = window.PWT || {};
window.pbjs = window.pbjs || {};

var refThis = this;

// Desc: Uses prebid js render ad function to call cache and render ad based on the params from response.
// Param Defination 
exports.renderCreative = function (cacheUrl, cachePath, uuid) {
	if (cacheUrl && uuid) {
		window.pbjs.renderAd(document, "", {
			cacheHost: cacheUrl,
			cachePath: cachePath,
			uuid: uuid,
			mediaType: "banner",
		});
	}
};

exports.removeProtocolFromUrl = function(url){
	var outPuturl = url || "";
	if(url && url.length > 0){
		outPuturl = url.replace(/^http:\/\//i, "");
		outPuturl = url.replace(/^https:\/\//i, "");
	}
	return outPuturl;
}

///  Change name to general render function : renderOWCreative
window.PWT.renderOWCreative = function (targetingKeys) {
	if (targetingKeys) {
		var cacheid = targetingKeys.cacheid || "";
		var cacheURL = targetingKeys.cacheURL || "";
		var cachePath = targetingKeys.cachePath || "/cache";
		if (cacheURL.length > 0 && cacheid.length > 0) {
		    cacheUrl = refThis.removeProtocolFromUrl(cacheURL); // removes protocol from url if present and returns host only
			refThis.renderCreative(cacheURL, cachePath, cacheid);
		}
	} else {
		// Condition : Although the creative has won but it does not contain targeting keys required to render ad
		// error at dfp configuration.
	}
};<commit_msg>Fixed a typo<commit_after>require("prebid-universal-creative");

window.PWT = window.PWT || {};
window.pbjs = window.pbjs || {};

var refThis = this;

// Desc: Uses prebid js render ad function to call cache and render ad based on the params from response.
// Param Defination 
exports.renderCreative = function (cacheUrl, cachePath, uuid) {
	if (cacheUrl && uuid) {
		window.pbjs.renderAd(document, "", {
			cacheHost: cacheUrl,
			cachePath: cachePath,
			uuid: uuid,
			mediaType: "banner",
		});
	}
};

exports.removeProtocolFromUrl = function(url){
	var outputUrl = url || "";
	if(url && url.length > 0){
		outputUrl = url.replace(/^http:\/\//i, "");
		outputUrl = url.replace(/^https:\/\//i, "");
	}
	return outputUrl;
}

///  Change name to general render function : renderOWCreative
window.PWT.renderOWCreative = function (targetingKeys) {
	if (targetingKeys) {
		var cacheid = targetingKeys.cacheid || "";
		var cacheURL = targetingKeys.cacheURL || "";
		var cachePath = targetingKeys.cachePath || "/cache";
		if (cacheURL.length > 0 && cacheid.length > 0) {
		    cacheURL = refThis.removeProtocolFromUrl(cacheURL); // removes protocol from url if present and returns host only
			refThis.renderCreative(cacheURL, cachePath, cacheid);
		}
	} else {
		// Condition : Although the creative has won but it does not contain targeting keys required to render ad
		// error at dfp configuration.
	}
};
{'fraction_non_alphanumeric': 0.13660618996798293, 'fraction_numerical': 0.0021344717182497333, 'mean_word_length': 3.8399311531841653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6068594', 'n_tokens_mistral': 942, 'n_tokens_neox': 887, 'n_words': 250}