diff --git a/src/display/display_utils.js b/src/display/display_utils.js index b1292858b4110..aa744a4878afb 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -447,7 +447,10 @@ function addLinkAttributes(link, { url, target, rel, enabled = true } = {}) { link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL; } -// Gets the file name from a given URL. +/** + * Gets the file name from a given URL. + * @param {string} url + */ function getFilenameFromUrl(url) { const anchor = url.indexOf("#"); const query = url.indexOf("?"); @@ -521,6 +524,10 @@ function isValidFetchUrl(url, baseUrl) { } } +/** + * @param {string} src + * @returns {Promise} + */ function loadScript(src) { return new Promise((resolve, reject) => { const script = document.createElement("script"); diff --git a/src/shared/util.js b/src/shared/util.js index 27ea302839180..525f40461a2ef 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -467,6 +467,9 @@ class AbortException extends BaseException {} const NullCharactersRegExp = /\x00/g; +/** + * @param {string} str + */ function removeNullCharacters(str) { if (typeof str !== "string") { warn("The argument for removeNullCharacters must be a string.");