INNER CODE UNIT · JavaScript

getSetting

cisagov/ScubaGoggles · scubagoggles/reporter/scripts/main.js:18

const getSetting = (setting) => {
    if (!setting) {
        return undefined;
    }
    let reportSettings = sessionStorage.getItem("sgr_settings");
    if (reportSettings === null || reportSettings === undefined) {
        return undefined;
    }
    return JSON.parse(reportSettings)[setting];
}

/**
 * Updates the report settings object in session storage.
 * @param {string} option sgr_settings option to update
 * @param {string} value update value for sgr_settings option
 */
const updateSettings = (option, value) => {
    let settings = {};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…