lib/swig.js
function remapBlocks(blocks, tokens) {
    return utils.map(tokens, function (token) {
      var args = token.args ? token.args.join('') : '';
      if (token.name === 'block' && blocks[args]) {
        token = blocks[args];
      }
      if (token.content && token.content.length) {
        token.content = remapBlocks(blocks, token.content);
      }
      return token;
    });
  }
function remapBlocks(blocks, tokens) {
    return utils.map(tokens, function (token) {
      var args = token.args ? token.args.join('') : '';
      if (token.name === 'block' && blocks[args]) {
        token = blocks[args];
      }
      if (token.content && token.content.length) {
        token.content = remapBlocks(blocks, token.content);
      }
      return token;
    });
  }
function remapBlocks ( blocks , tokens ) { return utils . map ( tokens , function ( token ) { var args = token . args ? token . args . join ( '' ) : '' ; if ( token . name === 'block' && blocks [ args ] ) { token = blocks [ args ] ; } if ( token . content && token . content . length ) { token . content = remapBlocks ( blocks , token . content ) ; } return token ; } ) ; }
Re-Map blocks within a list of tokens to the template's block objects.
@param  {array}  tokens   List of tokens for the parent object.
@param  {object} template Current template that needs to be mapped to the  parent's block and token list.
@return {array}
@private
Re - Map blocks within a list of tokens to the template s block objects .