<h1><a href="https://deepdash.io/"><img width="40%" src="https://cdn.jsdelivr.net/npm/deepdash@latest/deepdash.full.svg"></a></h1>
<blockquote>➔ 𝐃eep standalone lib / 𝐋odash extension: ✓ eachDeep ✓ filterDeep ✓ mapDeep ✓ reduceDeep ✓ pickDeep ✓ omitDeep ✓ keysDeep ✓ index ✓ condenseDeep ⋮ Parents stack ⋮ Circular check ⋮ Leaves only mode ⋮ Children mode ⋮ cherry-pick ⋮ esm</blockquote>
<h1><a href="https://spectrum.chat/deepdash/general/omitdeep-is-not-filtering-statistics-alone-rest-data-is-getting-filtered~686706f0-adc2-4f16-ab68-00aadeaac4db?authed=true">omitDeep</a> - omitDeep is not filtering "statistics" alone. Rest data is getting filtered</h1>
<div id="console"></div>
body{
  background-color: #002b36;
  color: #CCC;
  padding:20px;
}
h1 {
  font-size:32px;
  a{
    font-size:48px;
  }
}
a {
  color:#0078dc;
}
#console {
  input[type=checkbox]{
    display:none;
  }
  .title {
    margin-bottom: 6px;    
  }
  label{
    cursor:pointer;
    color: #CCC;
    .collapse {
      display:none;
    }
    .expand {
      display:inline;
    }
  }
  input[type=checkbox]:checked + .title label {
    color: #CCC;
    .collapse {
      display:inline;
    }
    .expand {
      display:none;
    }
  }
  
  pre {
    display: none;
    border: 1px dashed #CCC;
    margin-top: 0px;
    margin-bottom:40px;
  }
  input[type=checkbox]:checked + .title + pre {
    display: block;
  }
  margin-top:10px;
  padding:5px;
  font-family: monospace;
  color:teal;
}
View Compiled
deepdash(_); // mixin Deepdash methods into Lodash

var data = {
  "statistics": {}
};
var rxs = [/statistics/];
logJSON('Source Data',data, true);
data = _.omitDeep(data, rxs);
logJSON('Filtered Data',data);





































// boring stuff
var consoleEl;
var consoleN=0;

function log(title, txt, collapsed){
  if(!consoleN)
    consoleN=1
  else
    consoleN++;
  if(!consoleEl){
    consoleEl = document.getElementById('console');
  }
  var toggleEl = document.createElement("input");
  toggleEl.setAttribute('type','checkbox');
  toggleEl.setAttribute('id','con-'+consoleN);
  toggleEl.checked=!collapsed;
  var titleEl = document.createElement("div");
  titleEl.classList.add('title');
  titleEl.innerHTML = '<label for="con-'+consoleN+'"><span class="expand">›››</span><span class="collapse">‹‹‹</span>'+' '+title+'<span class="expand">...</span></label>';
  consoleEl.appendChild(toggleEl);
  consoleEl.appendChild(titleEl);
  if(txt===undefined) return;
  
  if(_.isArray(txt))
    txt = txt.join('\n');
  var block = document.createElement("pre");
  block.innerHTML='<code>'+txt+'</code>';
  hljs.highlightBlock(block);
  
  consoleEl.appendChild(block);
}


function logJSON(title,data,collapsed){
  return log(title,JSON.stringify(data,null,2),collapsed);
}

External CSS

  1. https://cdn.jsdelivr.net/npm/highlight.js@9.15.6/styles/solarized-dark.css

External JavaScript

  1. https://cdn.jsdelivr.net/npm/deepdash@4.5.4/browser/deepdash.min.js
  2. https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.6/build/highlight.min.js
  3. https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js