dist/objectSubset.js
function createLookUp(keywords) {

    return keywords.reduce(function(p, c) {

      c.split('.').reduce(function(pr, cu) {

        if (pr.hasOwnProperty(cu)) {

          return pr[cu];

        } else {

          pr[cu] = {};
          return pr[cu];

        }

      }, p);

      return p;

    }, {});

  }
function createLookUp(keywords) {

    return keywords.reduce(function(p, c) {

      c.split('.').reduce(function(pr, cu) {

        if (pr.hasOwnProperty(cu)) {

          return pr[cu];

        } else {

          pr[cu] = {};
          return pr[cu];

        }

      }, p);

      return p;

    }, {});

  }
function createLookUp ( keywords ) { return keywords . reduce ( function ( p , c ) { c . split ( '.' ) . reduce ( function ( pr , cu ) { if ( pr . hasOwnProperty ( cu ) ) { return pr [ cu ] ; } else { pr [ cu ] = { } ; return pr [ cu ] ; } } , p ) ; return p ; } , { } ) ; }
createLookUp iterates over every keyword and creates a tree
where the leaves are empty objects. The lookup object is used
to be able to traverse along the input document.
createLookUp iterates over every keyword and creates a tree where the leaves are empty objects . The lookup object is used to be able to traverse along the input document .