node_modules/mdast-util-definitions/index.js
/* Gather all definitions in `node` */
Gather all definitions in `node`
Gather all definitions in ` node `
function gather(node, options) {
  var cache = {};
  if (!node || !node.type) {
    throw new Error('mdast-util-definitions expected node');
  }
  visit(node, 'definition', options && options.commonmark ? commonmark : normal);
  return cache;
  function commonmark(definition) {
    var id = normalise(definition.identifier);
    if (!own.call(cache, id)) {
      cache[id] = definition;
    }
  }
  function normal(definition) {
    cache[normalise(definition.identifier)] = definition;
  }
}
function gather ( node , options ) { var cache = { } ; if ( ! node || ! node . type ) { throw new Error ( 'mdast-util-definitions expected node' ) ; } visit ( node , 'definition' , options && options . commonmark ? commonmark : normal ) ; return cache ; function commonmark ( definition ) { var id = normalise ( definition . identifier ) ; if ( ! own . call ( cache , id ) ) { cache [ id ] = definition ; } } function normal ( definition ) { cache [ normalise ( definition . identifier ) ] = definition ; } }
Gather all definitions in `node`
Gather all definitions in ` node `