当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript underscore.extend函数代码示例

本文整理汇总了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;未经允许,请勿转载。