• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript lodash.escape函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中lodash.escape函数的典型用法代码示例。如果您正苦于以下问题:TypeScript escape函数的具体用法?TypeScript escape怎么用?TypeScript escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了escape函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: getMessageType

 messages.forEach(function(message) {
     const type = (message as any).fatal ? "error" : "failure";
     output += '<testcase time="0" name="org.eslint.' + (message.ruleId || "unknown") + '">';
     output += "<" + type + ' message="' + lodash.escape(message.message || "") + '">';
     output += "<![CDATA[";
     output += "line " + (message.line || 0) + ", col ";
     output += (message.column || 0) + ", " + getMessageType(message);
     output += " - " + lodash.escape(message.message || "");
     output += message.ruleId ? " (" + message.ruleId + ")" : "";
     output += "]]>";
     output += "</" + type + ">";
     output += "</testcase>\n";
 });
开发者ID:textlint,项目名称:textlint,代码行数:13,代码来源:junit.ts


示例2: render

function render(token:Token, options:Options) : string {
  if(token instanceof FormulaToken) return renderFormula(token, options)
  if(token instanceof LinkToken)    return renderLink(token, options)
  if(token instanceof FormatToken)  return token.children.map(child => render(child, options)).join('') 
  if(token instanceof StrToken)     return _.escape(token.str || '')
  return ''
}
开发者ID:TrystalNet,项目名称:trystup,代码行数:7,代码来源:render-text.ts


示例3: render

function render(token:Token, options:Options) : string {
  if(token instanceof FormulaToken) return renderFormula(token, options)
  if(token instanceof LinkToken)    return renderLink(token, options)
  if(token instanceof FormatToken)  return renderFormat(token, options)
  if(token instanceof StrToken)     return _.escape(token.str || '')
  return ''
}
开发者ID:TrystalNet,项目名称:trystup,代码行数:7,代码来源:render-html.ts


示例4: renderCell

  renderCell(columnIndex, value, addWidthHack = false, rowLink = '') {
    value = this.formatColumnValue(columnIndex, value);

    if (value !== undefined) {
      value = _.escape(value);
    }

    var style = this.compileStyles();

    // because of the fixed table headers css only solution
    // there is an issue if header cell is wider the cell
    // this hack adds header content to cell (not visible)
    var widthHack = '';
    if (addWidthHack) {
      widthHack = '<div class="table-panel-width-hack">' + this.table.columns[columnIndex].text + '</div>';
    }

    if (value === undefined) {
      style = ' style="display:none;"';
      this.table.columns[columnIndex].hidden = true;
    } else {
      this.table.columns[columnIndex].hidden = false;
      if (rowLink !== '') {
        value = '<a href="' + rowLink + '" target="_new">' + value + '</a>';
      }
    }

    return '<td' + style + ' align="' + this.alignState + '">' + value + widthHack + '</td>';
  }
开发者ID:madshall,项目名称:grafana,代码行数:29,代码来源:renderer.ts


示例5: render

  render(page) {
    let pageSize = this.panel.pageSize || 100;
    let startPos = page * pageSize;
    let endPos = Math.min(startPos + pageSize, this.table.rows.length);
    var html = "";

    for (var y = startPos; y < endPos; y++) {
      let row = this.table.rows[y];
      let cellHtml = '';
      let rowStyle = '';
      let rowLink = this.panel.rowLink;

      if (rowLink) {
        for (var i = 0; i < this.table.columns.length; i++) {
          rowLink = rowLink.replace('$' + this.table.columns[i].text, _.escape(row[i]));
        }
      }

      for (var i = 0; i < this.table.columns.length; i++) {
        cellHtml += this.renderCell(i, row[i], y === startPos, rowLink);
      }

      if (this.colorState.row) {
        rowStyle = ' style="background-color:' + this.colorState.row + ';color: white"';
        this.colorState.row = null;
      }

      html += '<tr ' + rowStyle + '>' + cellHtml + '</tr>';
    }

    return html;
  }
开发者ID:madshall,项目名称:grafana,代码行数:32,代码来源:renderer.ts


示例6: emitCompileViewError

export function emitCompileViewError( content: string, err: TypeError, filename: string ) : relaxjs.RxError {
  var errTitle = '[error] Compiling View: %s'+ filename ;
  var errMsg = err.message;
  var code =  format('<h4>Content being compiled</h4><pre>{0}</pre>', _.escape(content));
  _log.error(errTitle);
  return new relaxjs.RxError(errMsg, errTitle, 500, code );
}
开发者ID:micurs,项目名称:relaxjs,代码行数:7,代码来源:internals.ts


示例7: renderCell

  renderCell(columnIndex, value, addWidthHack = false) {
    value = this.formatColumnValue(columnIndex, value);
    value = _.escape(value);
    var style = '';
    if (this.colorState.cell) {
      style = ' style="background-color:' + this.colorState.cell + ';color: white"';
      this.colorState.cell = null;
    } else if (this.colorState.value) {
      style = ' style="color:' + this.colorState.value + '"';
      this.colorState.value = null;
    }

    // because of the fixed table headers css only solution
    // there is an issue if header cell is wider the cell
    // this hack adds header content to cell (not visible)
    var widthHack = '';
    if (addWidthHack) {
      widthHack = '<div class="table-panel-width-hack">' + this.table.columns[columnIndex].text + '</div>';
    }

    if (value.indexOf("http") > -1) {
      return '<td' + style + '><a href=\"' + value + '\" target=\"_blank\">' + value + widthHack + '</a></td>';
    } else {
      return '<td' + style + '>' + value + widthHack + '</td>';
    }
  }
开发者ID:smur89,项目名称:grafana,代码行数:26,代码来源:renderer.ts


示例8: renderCell

  renderCell(columnIndex, value, addWidthHack = false) {
    value = this.formatColumnValue(columnIndex, value);

    if (value !== undefined) {
      value = _.escape(value);
    }

    var style = '';
    if (this.colorState.cell) {
      style = ' style="background-color:' + this.colorState.cell + ';color: white"';
      this.colorState.cell = null;
    } else if (this.colorState.value) {
      style = ' style="color:' + this.colorState.value + '"';
      this.colorState.value = null;
    }

    // because of the fixed table headers css only solution
    // there is an issue if header cell is wider the cell
    // this hack adds header content to cell (not visible)
    var widthHack = '';
    if (addWidthHack) {
      widthHack = '<div class="table-panel-width-hack">' + this.table.columns[columnIndex].text + '</div>';
    }

    if (value === undefined) {
      style = ' style="display:none;"';
      this.table.columns[columnIndex].hidden = true;
    } else {
      this.table.columns[columnIndex].hidden = false;
    }

    return '<td' + style + '>' + value + widthHack + '</td>';
  }
开发者ID:madshall,项目名称:grafana-custom,代码行数:33,代码来源:renderer.ts


示例9: sanitizeString

 function sanitizeString(str) {
   try {
     return $sanitize(str);
   } catch (err) {
     console.log('Could not sanitize annotation string, html escaping instead');
     return _.escape(str);
   }
 }
开发者ID:ArcticSnowman,项目名称:grafana,代码行数:8,代码来源:annotation_tooltip.ts


示例10: callback

            $scope.handleEvent({ $event: { name: 'get-param-options', param: param } }).then((result: any) => {
              const dynamicOptions = _.map(result, op => {
                return _.escape(op.value);
              });

              // add current value to dropdown if it's not in dynamicOptions
              if (_.indexOf(dynamicOptions, part.params[paramIndex]) === -1) {
                dynamicOptions.unshift(_.escape(part.params[paramIndex]));
              }

              callback(dynamicOptions);
            });
开发者ID:grafana,项目名称:grafana,代码行数:12,代码来源:sql_part_editor.ts



注:本文中的lodash.escape函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript lodash.escapeRegExp函数代码示例发布时间:2022-05-25
下一篇:
TypeScript lodash.eq函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap