dist/nornj.common.js
function _getSplitParams(elem, tmplRule, outputH) {
  var extensionRule = tmplRule.extensionRule,
      startRule = tmplRule.startRule,
      endRule = tmplRule.endRule,
      firstChar = tmplRule.firstChar,
      lastChar = tmplRule.lastChar,
      spreadProp = tmplRule.spreadProp,
      directives = tmplRule.directives;
  var paramsEx; //Replace the parameter like "{...props}".

  elem = elem.replace(spreadProp, function (all, g1, propR, g3, prop) {
    if (propR) {
      prop = propR;
    }

    if (!paramsEx) {
      paramsEx = [extensionRule + 'props'];
    }

    paramsEx.push([extensionRule + 'spread ' + (propR ? firstChar : '') + startRule + prop.replace(/\.\.\./, '') + endRule + (propR ? lastChar : '') + '/']);
    return ' ';
  }); //Replace the parameter like "#show={false}".

  elem = elem.replace(directives, function (all, g1, g2, g3, g4, g5, g6, key, hasColon, hasEx, name, hasEqual, value) {
    if (hasEx == null) {
      return all;
    }

    if (!paramsEx) {
      paramsEx = [extensionRule + 'props'];
    }

    var args, modifiers;
    name = name.replace(REGEX_EX_ATTR, function (all, name, modifier, g3, arg) {
      if (arg) {
        args = arg.substr(1).split('-').map(function (item) {
          var argStr;
          var modifierStr = '';
          var strs = item.split(/[$.]/);
          strs.forEach(function (str, i) {
            if (i == 0) {
              argStr = 'name:\'' + str + '\'' + (i < strs.length - 1 ? ',' : '');
            } else {
              modifierStr += '\'' + str + '\'' + (i < strs.length - 1 ? ',' : '');
            }
          });
          return '{' + argStr + (modifierStr != '' ? 'modifiers:[' + modifierStr + ']' : '') + '}';
        });
      }

      if (modifier) {
        modifiers = modifier.substr(1).split(/[$.]/).map(function (item) {
          return '\'' + item + '\'';
        });
      }

      return name;
    });
    var exPreAst = [extensionRule + name + ' _njIsDirective' + (args ? ' arguments="' + firstChar + startRule + '[' + args.join(',') + ']' + endRule + lastChar + '"' : '') + (modifiers ? ' modifiers="' + startRule + '[' + modifiers.join(',') + ']' + endRule + '"' : '') + (hasEqual ? '' : ' /')];
    hasEqual && exPreAst.push((hasColon ? (outputH ? firstChar : '') + startRule + ' ' : '') + clearQuot(value) + (hasColon ? ' ' + endRule + (outputH ? lastChar : '') : ''));
    paramsEx.push(exPreAst);
    return ' ';
  });
  return {
    elem: elem,
    params: paramsEx
  };
}
function _getSplitParams(elem, tmplRule, outputH) {
  var extensionRule = tmplRule.extensionRule,
      startRule = tmplRule.startRule,
      endRule = tmplRule.endRule,
      firstChar = tmplRule.firstChar,
      lastChar = tmplRule.lastChar,
      spreadProp = tmplRule.spreadProp,
      directives = tmplRule.directives;
  var paramsEx; //Replace the parameter like "{...props}".

  elem = elem.replace(spreadProp, function (all, g1, propR, g3, prop) {
    if (propR) {
      prop = propR;
    }

    if (!paramsEx) {
      paramsEx = [extensionRule + 'props'];
    }

    paramsEx.push([extensionRule + 'spread ' + (propR ? firstChar : '') + startRule + prop.replace(/\.\.\./, '') + endRule + (propR ? lastChar : '') + '/']);
    return ' ';
  }); //Replace the parameter like "#show={false}".

  elem = elem.replace(directives, function (all, g1, g2, g3, g4, g5, g6, key, hasColon, hasEx, name, hasEqual, value) {
    if (hasEx == null) {
      return all;
    }

    if (!paramsEx) {
      paramsEx = [extensionRule + 'props'];
    }

    var args, modifiers;
    name = name.replace(REGEX_EX_ATTR, function (all, name, modifier, g3, arg) {
      if (arg) {
        args = arg.substr(1).split('-').map(function (item) {
          var argStr;
          var modifierStr = '';
          var strs = item.split(/[$.]/);
          strs.forEach(function (str, i) {
            if (i == 0) {
              argStr = 'name:\'' + str + '\'' + (i < strs.length - 1 ? ',' : '');
            } else {
              modifierStr += '\'' + str + '\'' + (i < strs.length - 1 ? ',' : '');
            }
          });
          return '{' + argStr + (modifierStr != '' ? 'modifiers:[' + modifierStr + ']' : '') + '}';
        });
      }

      if (modifier) {
        modifiers = modifier.substr(1).split(/[$.]/).map(function (item) {
          return '\'' + item + '\'';
        });
      }

      return name;
    });
    var exPreAst = [extensionRule + name + ' _njIsDirective' + (args ? ' arguments="' + firstChar + startRule + '[' + args.join(',') + ']' + endRule + lastChar + '"' : '') + (modifiers ? ' modifiers="' + startRule + '[' + modifiers.join(',') + ']' + endRule + '"' : '') + (hasEqual ? '' : ' /')];
    hasEqual && exPreAst.push((hasColon ? (outputH ? firstChar : '') + startRule + ' ' : '') + clearQuot(value) + (hasColon ? ' ' + endRule + (outputH ? lastChar : '') : ''));
    paramsEx.push(exPreAst);
    return ' ';
  });
  return {
    elem: elem,
    params: paramsEx
  };
}
function _getSplitParams ( elem , tmplRule , outputH ) { var extensionRule = tmplRule . extensionRule , startRule = tmplRule . startRule , endRule = tmplRule . endRule , firstChar = tmplRule . firstChar , lastChar = tmplRule . lastChar , spreadProp = tmplRule . spreadProp , directives = tmplRule . directives ; var paramsEx ; //Replace the parameter like "{...props}". elem = elem . replace ( spreadProp , function ( all , g1 , propR , g3 , prop ) { if ( propR ) { prop = propR ; } if ( ! paramsEx ) { paramsEx = [ extensionRule + 'props' ] ; } paramsEx . push ( [ extensionRule + 'spread ' + ( propR ? firstChar : '' ) + startRule + prop . replace ( / \.\.\. / , '' ) + endRule + ( propR ? lastChar : '' ) + '/' ] ) ; return ' ' ; } ) ; //Replace the parameter like "#show={false}". elem = elem . replace ( directives , function ( all , g1 , g2 , g3 , g4 , g5 , g6 , key , hasColon , hasEx , name , hasEqual , value ) { if ( hasEx == null ) { return all ; } if ( ! paramsEx ) { paramsEx = [ extensionRule + 'props' ] ; } var args , modifiers ; name = name . replace ( REGEX_EX_ATTR , function ( all , name , modifier , g3 , arg ) { if ( arg ) { args = arg . substr ( 1 ) . split ( '-' ) . map ( function ( item ) { var argStr ; var modifierStr = '' ; var strs = item . split ( / [$.] / ) ; strs . forEach ( function ( str , i ) { if ( i == 0 ) { argStr = 'name:\'' + str + '\'' + ( i < strs . length - 1 ? ',' : '' ) ; } else { modifierStr += '\'' + str + '\'' + ( i < strs . length - 1 ? ',' : '' ) ; } } ) ; return '{' + argStr + ( modifierStr != '' ? 'modifiers:[' + modifierStr + ']' : '' ) + '}' ; } ) ; } if ( modifier ) { modifiers = modifier . substr ( 1 ) . split ( / [$.] / ) . map ( function ( item ) { return '\'' + item + '\'' ; } ) ; } return name ; } ) ; var exPreAst = [ extensionRule + name + ' _njIsDirective' + ( args ? ' arguments="' + firstChar + startRule + '[' + args . join ( ',' ) + ']' + endRule + lastChar + '"' : '' ) + ( modifiers ? ' modifiers="' + startRule + '[' + modifiers . join ( ',' ) + ']' + endRule + '"' : '' ) + ( hasEqual ? '' : ' /' ) ] ; hasEqual && exPreAst . push ( ( hasColon ? ( outputH ? firstChar : '' ) + startRule + ' ' : '' ) + clearQuot ( value ) + ( hasColon ? ' ' + endRule + ( outputH ? lastChar : '' ) : '' ) ) ; paramsEx . push ( exPreAst ) ; return ' ' ; } ) ; return { elem : elem , params : paramsEx } ; }
Extract split parameters
Extract split parameters