fancy-facets

Generates array of dash seperated keys from a nested object of true values

Usage no npm install needed!

<script type="module">
  import fancyFacets from 'https://cdn.skypack.dev/fancy-facets';
</script>

README

NPM version"> Build Status Dependency Status

Generates array of dash seperated keys from a nested object of true values

Install

$ npm install --save fancy-facets

Usage

var facets = require('fancy-facets');

facets({
  'parent': {
    'child1': true,
    'child2': {
      'grandchild1': true,
      'grandchild2': false,
      'grandchild3': true
    },
    'child3': false,
    'child4: 'Bill'
  }
});

// ->[ 'parent-child1', 'parent-child2-grandchild1', 'parent-child2-grandchild3', 'parent-child4-bill']

License

MIT © Ray Gerrard