dist/tinybind.esm.js
// of text from binding declarations.
of text from binding declarations.
of text from binding declarations .
function parseTemplate(template, delimiters) {
  var tokens;
  var length = template.length;
  var index = 0;
  var lastIndex = 0;
  var open = delimiters[0],
      close = delimiters[1];
  while (lastIndex < length) {
    index = template.indexOf(open, lastIndex);
    if (index < 0) {
      if (tokens) {
        tokens.push({
          type: TEXT,
          value: template.slice(lastIndex)
        });
      }
      break;
    } else {
      tokens || (tokens = []);
      if (index > 0 && lastIndex < index) {
        tokens.push({
          type: TEXT,
          value: template.slice(lastIndex, index)
        });
      }
      lastIndex = index + open.length;
      index = template.indexOf(close, lastIndex);
      if (index < 0) {
        var substring = template.slice(lastIndex - close.length);
        var lastToken = tokens[tokens.length - 1];
        if (lastToken && lastToken.type === TEXT) {
          lastToken.value += substring;
        } else {
          tokens.push({
            type: TEXT,
            value: substring
          });
        }
        break;
      }
      var value = template.slice(lastIndex, index).trim();
      tokens.push({
        type: BINDING,
        value: value
      });
      lastIndex = index + close.length;
    }
  }
  return tokens;
}
function parseTemplate ( template , delimiters ) { var tokens ; var length = template . length ; var index = 0 ; var lastIndex = 0 ; var open = delimiters [ 0 ] , close = delimiters [ 1 ] ; while ( lastIndex < length ) { index = template . indexOf ( open , lastIndex ) ; if ( index < 0 ) { if ( tokens ) { tokens . push ( { type : TEXT , value : template . slice ( lastIndex ) } ) ; } break ; } else { tokens || ( tokens = [ ] ) ; if ( index > 0 && lastIndex < index ) { tokens . push ( { type : TEXT , value : template . slice ( lastIndex , index ) } ) ; } lastIndex = index + open . length ; index = template . indexOf ( close , lastIndex ) ; if ( index < 0 ) { var substring = template . slice ( lastIndex - close . length ) ; var lastToken = tokens [ tokens . length - 1 ] ; if ( lastToken && lastToken . type === TEXT ) { lastToken . value += substring ; } else { tokens . push ( { type : TEXT , value : substring } ) ; } break ; } var value = template . slice ( lastIndex , index ) . trim ( ) ; tokens . push ( { type : BINDING , value : value } ) ; lastIndex = index + close . length ; } } return tokens ; }
of text from binding declarations.
of text from binding declarations .