﻿function SWStandaardwaarden() { }

SWStandaardwaarden.getWaarde = function (waarde) {
    let jsonwaarden = SWStorage.getValue("portalstandaardwaarden");

    let s = jsonwaarden.replace(/\\n/g, "\\n")
        .replace(/\\'/g, "\\'")
        .replace(/\\"/g, '\\"')
        .replace(/\\&/g, "\\&")
        .replace(/\\r/g, "\\r")
        .replace(/\\t/g, "\\t")
        .replace(/\\b/g, "\\b")
        .replace(/\\f/g, "\\f");
    // remove non-printable and other non-valid JSON chars
    s = s.replace(/[\u0000-\u0019]+/g, "");

    let waarden = JSON.parse(s);
    let val = waarden[waarde];
    return val;
}