web/static/scripts/redisCommander.js
function enableJsonValidationCheck(value, isJsonCheckBox) {
  try {
    JSON.parse(value);
    // if this is valid json and is array or object assume we want validation active
    if (value.match(/^\s*[{\[]/)) {
      $(isJsonCheckBox).click();
    }
  }
  catch (ex) {
    // do nothing
  }
}
function enableJsonValidationCheck(value, isJsonCheckBox) {
  try {
    JSON.parse(value);
    // if this is valid json and is array or object assume we want validation active
    if (value.match(/^\s*[{\[]/)) {
      $(isJsonCheckBox).click();
    }
  }
  catch (ex) {
    // do nothing
  }
}
function enableJsonValidationCheck ( value , isJsonCheckBox ) { try { JSON . parse ( value ) ; // if this is valid json and is array or object assume we want validation active if ( value . match ( / ^\s*[{\[] / ) ) { $ ( isJsonCheckBox ) . click ( ) ; } } catch ( ex ) { // do nothing } }
check if given string value is valid json and, if so enable validation
for given field if this is an json object or array. Do not automatically
enable validation on numbers or quted strings. May be coincidence that this is json...

@param {string} value string to check if valid json
@param {string} isJsonCheckBox id string of checkbox element to activate validation
check if given string value is valid json and if so enable validation for given field if this is an json object or array . Do not automatically enable validation on numbers or quted strings . May be coincidence that this is json ...