mini-program-cljs
Version:
74 lines (72 loc) • 3.92 kB
JavaScript
goog.provide("goog.html.uncheckedconversions");
goog.require("goog.asserts");
goog.require("goog.html.SafeHtml");
goog.require("goog.html.SafeScript");
goog.require("goog.html.SafeStyle");
goog.require("goog.html.SafeStyleSheet");
goog.require("goog.html.SafeUrl");
goog.require("goog.html.TrustedResourceUrl");
goog.require("goog.string.Const");
goog.require("goog.string.internal");
/**
* @param {!goog.string.Const} justification
* @param {string} html
* @param {?goog.i18n.bidi.Dir=} opt_dir
* @return {!goog.html.SafeHtml}
*/
goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract = function(justification, html, opt_dir) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(html, opt_dir || null);
};
/**
* @param {!goog.string.Const} justification
* @param {string} script
* @return {!goog.html.SafeScript}
*/
goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract = function(justification, script) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(script);
};
/**
* @param {!goog.string.Const} justification
* @param {string} style
* @return {!goog.html.SafeStyle}
*/
goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract = function(justification, style) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(style);
};
/**
* @param {!goog.string.Const} justification
* @param {string} styleSheet
* @return {!goog.html.SafeStyleSheet}
*/
goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract = function(justification, styleSheet) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(styleSheet);
};
/**
* @param {!goog.string.Const} justification
* @param {string} url
* @return {!goog.html.SafeUrl}
*/
goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract = function(justification, url) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(url);
};
/**
* @param {!goog.string.Const} justification
* @param {string} url
* @return {!goog.html.TrustedResourceUrl}
*/
goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract = function(justification, url) {
goog.asserts.assertString(goog.string.Const.unwrap(justification), "must provide justification");
goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(justification)), "must provide non-empty justification");
return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(url);
};
//# sourceMappingURL=goog.html.uncheckedconversions.js.map