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

TypeScript underscore.extend函数代码示例

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

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



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

示例1: format

// Converts a map to a string space-delimited key=val pairs
function format(data) {
  if (deploy_env || workflow_id || pod_id || pod_account || pod_region) {
    const extras: any = {};
    if (deploy_env) { extras.deploy_env = deploy_env; }
    if (workflow_id) { extras.wf_id = workflow_id; }
    if (pod_id) { extras["pod-id"] = pod_id; }
    if (pod_region) { extras["pod-region"] = pod_region; }
    if (pod_account) { extras["pod-account"] = pod_account; }

    return JSON.stringify(_.extend(extras, data), replaceErrors);
  }
  return JSON.stringify(data, replaceErrors);
}
开发者ID:Clever,项目名称:kayvee-js,代码行数:14,代码来源:kayvee.ts


示例2: sendType1Message

 // The following method is an adaptation of code found at https://github.com/SamDecrock/node-http-ntlm/blob/master/httpntlm.js
 private sendType1Message(httpClient, protocol, options, objs, keepaliveAgent, callback): void {
     var type1msg = ntlm.createType1Message(options);
     var type1options = {
         headers: {
             'Connection': 'keep-alive',
             'Authorization': type1msg
         },
         timeout: options.timeout || 0,
         agent: keepaliveAgent,
          // don't redirect because http could change to https which means we need to change the keepaliveAgent
         allowRedirects: false
     };
     type1options = _.extend(type1options, _.omit(options, 'headers'));
     httpClient.requestInternal(protocol, type1options, objs, callback);
 }
开发者ID:grawcho,项目名称:vsts-node-api,代码行数:16,代码来源:ntlm.ts


示例3: function

    select: function (label:string, args: any, options: OptionObj[]) : _mithril.MithrilVirtualElement {
        var id = label.replace(/\s/g, '');
        return  [
            m('label', {
                for: 'id'
            }, [
                label,
                m('select', _.extend({
                    name: id,
                    id: id
                }, args), _.map(options, objToOption))
            ]),

        ];
    },
开发者ID:SleepyPierre,项目名称:BarHigher_Proto,代码行数:15,代码来源:form.ts


示例4: fix

  fix(focus: Focus) {
    focus.xl = focus.xl < 0 ? 0 : focus.xl;
    focus.xr = focus.xr > 1 ? 1 : focus.xr;
    focus.yl = focus.yl < 0 ? 0 : focus.yl;
    focus.yr = focus.yr > 1 ? 1 : focus.yr;
    focus.yl_r = focus.yl_r < 0 ? 0 : focus.yl_r;
    focus.yr_r = focus.yr_r > 1 ? 1 : focus.yr_r;
    focus.xspan = focus.xr - focus.xl;
    focus.yspan = focus.yr - focus.yl;
    focus.yspan_r = focus.yr_r - focus.yl_r;

    if (focus.xl > focus.xr || focus.yl > focus.yr || focus.yl_r > focus.yr_r) {
      console.error("visible range specified does not match data range, " +
        "enforcing visible range");
      _.extend(focus, this.defaultFocus);
    }
  }
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:17,代码来源:PlotFocus.ts


示例5: _internalAnalyzePacket

function _internalAnalyzePacket(buffer: Buffer, stream: BinaryStream, objMessage: any, padding: number, customOptions?: AnalyzePacketOptions, offset?: number) {

    let options: any = make_tracer(buffer, padding, offset);
    options.name = "message";
    options = _.extend(options, customOptions);
    try {
        if (objMessage) {
            objMessage.decodeDebug(stream, options);
        } else {
            console.log(" Invalid object", objMessage);
        }
    } catch (err) {
        console.log(" Error in ", err);
        console.log(" Error in ", err.stack);
        console.log(" objMessage ", util.inspect(objMessage, {colors: true}));
    }
}
开发者ID:node-opcua,项目名称:node-opcua,代码行数:17,代码来源:packet_analyzer.ts


示例6: Exec

    public static async Exec(tfvc: ITfCommandLine, cwd: string, args: IArgumentProvider, options: any = {}): Promise<IExecutionResult> {
        // default to the cwd passed in, but allow options.cwd to overwrite it
        options = _.extend({ cwd }, options || {});

        // TODO: do we want to handle proxies or not for the EXE? for tf.exe the user could simply setup the proxy at the command line.
        //       tf.exe remembers the proxy settings and uses them as it needs to.
        if (tfvc.proxy && !tfvc.isExe) {
            args.AddProxySwitch(tfvc.proxy);
        }

        Logger.LogDebug(`TFVC: tf ${args.GetArgumentsForDisplay()}`);
        if (options.log !== false) {
            TfvcOutput.AppendLine(`tf ${args.GetArgumentsForDisplay()}`);
        }

        return await TfCommandLineRunner.run(tfvc, args, options, tfvc.isExe);
    }
开发者ID:Microsoft,项目名称:vsts-vscode,代码行数:17,代码来源:tfcommandlinerunner.ts


示例7:

      this.http.get(url).forEach(response => {
        let tempState = window.history.state;

        let a = response.json();
        if (a.data[0] !== 'Authorized') {
          this.appState.set('authenticated', true);
          this.appState.set('learn', true);
          this.router.navigate(['/welcome']);
          window.history.replaceState(undefined, undefined, '');
        } else {
          this.appState.set('authenticated', true);
          this.appState.set('isDisabled', false);
          this.router.navigate([`/${page}`]);
          tempState = _.extend(tempState, this.appState._state);
          window.history.pushState(tempState, undefined, page);
        }
      }).catch(err => console.log('ERROR:', err));
开发者ID:mybrainishuge,项目名称:hello,代码行数:17,代码来源:auth.service.ts


示例8: function

var DataForm = function (app, options) {
  this.app = app;
  app.locals.formsAngular = app.locals.formsAngular || [];
  app.locals.formsAngular.push(this);
  this.mongoose = mongoose;
  this.options = _.extend({
    urlPrefix: '/api/'
  }, options || {});
  this.resources = [ ];
  this.searchFunc = async.forEach;
  this.registerRoutes();
  this.app.get.apply(this.app, processArgs(this.options, ['search', this.searchAll()]));
  if (this.options.JQMongoFileUploader) {
    var JqUploadModule = this.options.JQMongoFileUploader.module || require('fng-jq-upload').Controller;
    this.fileUploader = new JqUploadModule(this, processArgs, this.options.JQMongoFileUploader);
    void (this.fileUploader);  // suppress warning
  }
};
开发者ID:zettacristiano,项目名称:forms-angular,代码行数:18,代码来源:data_form.ts


示例9:

      this.http.get(url).forEach(response => {
        var tempState = window.history.state;

        let a = response.json();
        if(a.data[0] !== "Authorized") {
          this.appState.set('authenticated', true);
          this.appState.set('learn', true);
          this.router.navigate(['/welcome']);
          window.history.replaceState(null, null, '');
        } else {
          this.appState.set('authenticated', true);
          this.appState.set('isDisabled', false);
          this.router.navigate(['/'+page]);
          tempState = _.extend(tempState, this.appState._state);
          console.log('temp', tempState);
          window.history.pushState(tempState, null, page);
        }
      }).catch(err => console.log("ERROR:", err));
开发者ID:ashjd,项目名称:hello,代码行数:18,代码来源:auth.service.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript underscore.filter函数代码示例发布时间:2022-05-25
下一篇:
TypeScript underscore.escape函数代码示例发布时间: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