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

TypeScript facade.isBlank函数代码示例

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

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



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

示例1: _parseChromeVersion

 private _parseChromeVersion(userAgent: string): number {
   if (isBlank(userAgent)) {
     return -1;
   }
   var v = StringWrapper.split(userAgent, /Chrom(e|ium)\//g)[2];
   if (isBlank(v)) {
     return -1;
   }
   v = v.split('.')[0];
   if (isBlank(v)) {
     return -1;
   }
   return NumberWrapper.parseInt(v, 10);
 }
开发者ID:4vanger,项目名称:angular,代码行数:14,代码来源:chrome_driver_extension.ts


示例2: createEndEvent

    records.forEach((record) => {
      var endEvent = null;
      var type = record['type'];
      var data = record['data'];
      var startTime = record['startTime'];
      var endTime = record['endTime'];

      if (StringWrapper.equals(type, 'FunctionCall') &&
          (isBlank(data) || !StringWrapper.equals(data['scriptName'], 'InjectedScript'))) {
        events.push(createStartEvent('script', startTime));
        endEvent = createEndEvent('script', endTime);
      } else if (StringWrapper.equals(type, 'Time')) {
        events.push(createMarkStartEvent(data['message'], startTime));
      } else if (StringWrapper.equals(type, 'TimeEnd')) {
        events.push(createMarkEndEvent(data['message'], startTime));
      } else if (StringWrapper.equals(type, 'RecalculateStyles') ||
                 StringWrapper.equals(type, 'Layout') ||
                 StringWrapper.equals(type, 'UpdateLayerTree') ||
                 StringWrapper.equals(type, 'Paint') || StringWrapper.equals(type, 'Rasterize') ||
                 StringWrapper.equals(type, 'CompositeLayers')) {
        events.push(createStartEvent('render', startTime));
        endEvent = createEndEvent('render', endTime);
      }
      // Note: ios used to support GCEvent up until iOS 6 :-(
      if (isPresent(record['children'])) {
        this._convertPerfRecordsToEvents(record['children'], events);
      }
      if (isPresent(endEvent)) {
        events.push(endEvent);
      }
    });
开发者ID:0xJoKe,项目名称:angular,代码行数:31,代码来源:ios_driver_extension.ts


示例3: _isEvent

 private _isEvent(eventCategories: string[], eventName: string, expectedCategories: string[],
                  expectedName: string = null): boolean {
   var hasCategories = expectedCategories.reduce(
       (value, cat) => { return value && ListWrapper.contains(eventCategories, cat); }, true);
   return isBlank(expectedName) ? hasCategories :
                                  hasCategories && StringWrapper.equals(eventName, expectedName);
 }
开发者ID:4vanger,项目名称:angular,代码行数:7,代码来源:chrome_driver_extension.ts


示例4: createExtension

 function createExtension(perfRecords = null, userAgent = null,
                          messageMethod = 'Tracing.dataCollected'): WebDriverExtension {
   if (isBlank(perfRecords)) {
     perfRecords = [];
   }
   if (isBlank(userAgent)) {
     userAgent = CHROME44_USER_AGENT;
   }
   log = [];
   extension =
       ReflectiveInjector.resolveAndCreate([
                           ChromeDriverExtension.BINDINGS,
                           bind(WebDriverAdapter)
                               .toValue(new MockDriverAdapter(log, perfRecords, messageMethod)),
                           bind(Options.USER_AGENT).toValue(userAgent)
                         ])
           .get(ChromeDriverExtension);
   return extension;
 }
开发者ID:2blessed2bstressedbythedevilsmess,项目名称:angular,代码行数:19,代码来源:chrome_driver_extension_spec.ts


示例5: createMetric

 function createMetric(perfLogs, perfLogFeatures,
                       {microMetrics, forceGc, captureFrames, receivedData, requestCount}: {
                         microMetrics?: {[key: string]: string},
                         forceGc?: boolean,
                         captureFrames?: boolean,
                         receivedData?: boolean,
                         requestCount?: boolean
                       } = {}): Metric {
   commandLog = [];
   if (isBlank(perfLogFeatures)) {
     perfLogFeatures =
         new PerfLogFeatures({render: true, gc: true, frameCapture: true, userTiming: true});
   }
   if (isBlank(microMetrics)) {
     microMetrics = StringMapWrapper.create();
   }
   var bindings = [
     Options.DEFAULT_PROVIDERS,
     PerflogMetric.BINDINGS,
     bind(Options.MICRO_METRICS).toValue(microMetrics),
     bind(PerflogMetric.SET_TIMEOUT)
         .toValue((fn, millis) => {
           commandLog.push(['setTimeout', millis]);
           fn();
         }),
     bind(WebDriverExtension)
         .toValue(new MockDriverExtension(perfLogs, commandLog, perfLogFeatures))
   ];
   if (isPresent(forceGc)) {
     bindings.push(bind(Options.FORCE_GC).toValue(forceGc));
   }
   if (isPresent(captureFrames)) {
     bindings.push(bind(Options.CAPTURE_FRAMES).toValue(captureFrames));
   }
   if (isPresent(receivedData)) {
     bindings.push(bind(Options.RECEIVED_DATA).toValue(receivedData));
   }
   if (isPresent(requestCount)) {
     bindings.push(bind(Options.REQUEST_COUNT).toValue(requestCount));
   }
   return ReflectiveInjector.resolveAndCreate(bindings).get(PerflogMetric);
 }
开发者ID:2blessed2bstressedbythedevilsmess,项目名称:angular,代码行数:42,代码来源:perflog_metric_spec.ts


示例6: createReporter

 function createReporter({columnWidth = null, sampleId = null, descriptions = null,
                          metrics = null}: {columnWidth?, sampleId?, descriptions?, metrics?}) {
   log = [];
   if (isBlank(descriptions)) {
     descriptions = [];
   }
   if (isBlank(sampleId)) {
     sampleId = 'null';
   }
   var bindings = [
     ConsoleReporter.BINDINGS,
     provide(SampleDescription,
             {useValue: new SampleDescription(sampleId, descriptions, metrics)}),
     bind(ConsoleReporter.PRINT).toValue((line) => log.push(line))
   ];
   if (isPresent(columnWidth)) {
     bindings.push(bind(ConsoleReporter.COLUMN_WIDTH).toValue(columnWidth));
   }
   reporter = ReflectiveInjector.resolveAndCreate(bindings).get(ConsoleReporter);
 }
开发者ID:2blessed2bstressedbythedevilsmess,项目名称:angular,代码行数:20,代码来源:console_reporter_spec.ts


示例7: normalizeEvent

function normalizeEvent(chromeEvent: {[key: string]: any},
                        data: {[key: string]: any}): {[key: string]: any} {
  var ph = chromeEvent['ph'];
  if (StringWrapper.equals(ph, 'S')) {
    ph = 'b';
  } else if (StringWrapper.equals(ph, 'F')) {
    ph = 'e';
  }
  var result =
      {'pid': chromeEvent['pid'], 'ph': ph, 'cat': 'timeline', 'ts': chromeEvent['ts'] / 1000};
  if (chromeEvent['ph'] === 'X') {
    var dur = chromeEvent['dur'];
    if (isBlank(dur)) {
      dur = chromeEvent['tdur'];
    }
    result['dur'] = isBlank(dur) ? 0.0 : dur / 1000;
  }
  StringMapWrapper.forEach(data, (value, prop) => { result[prop] = value; });
  return result;
}
开发者ID:4vanger,项目名称:angular,代码行数:20,代码来源:chrome_driver_extension.ts


示例8: _processAsPostChrome44Event

 private _processAsPostChrome44Event(event, categories) {
   var name = event['name'];
   var args = event['args'];
   if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MajorGC')) {
     var normArgs = {
       'majorGc': true,
       'usedHeapSize': isPresent(args['usedHeapSizeAfter']) ? args['usedHeapSizeAfter'] :
                                                              args['usedHeapSizeBefore']
     };
     return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MinorGC')) {
     var normArgs = {
       'majorGc': false,
       'usedHeapSize': isPresent(args['usedHeapSizeAfter']) ? args['usedHeapSizeAfter'] :
                                                              args['usedHeapSizeBefore']
     };
     return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'FunctionCall') &&
              (isBlank(args) || isBlank(args['data']) ||
               (!StringWrapper.equals(args['data']['scriptName'], 'InjectedScript') &&
                !StringWrapper.equals(args['data']['scriptName'], '')))) {
     return normalizeEvent(event, {'name': 'script'});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'blink'],
                            'UpdateLayoutTree')) {
     return normalizeEvent(event, {'name': 'render'});
   } else if (this._isEvent(categories, name, ['devtools.timeline'], 'UpdateLayerTree') ||
              this._isEvent(categories, name, ['devtools.timeline'], 'Layout') ||
              this._isEvent(categories, name, ['devtools.timeline'], 'Paint')) {
     return normalizeEvent(event, {'name': 'render'});
   } else if (this._isEvent(categories, name, ['devtools.timeline'], 'ResourceReceivedData')) {
     let normArgs = {'encodedDataLength': args['data']['encodedDataLength']};
     return normalizeEvent(event, {'name': 'receivedData', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['devtools.timeline'], 'ResourceSendRequest')) {
     let data = args['data'];
     let normArgs = {'url': data['url'], 'method': data['requestMethod']};
     return normalizeEvent(event, {'name': 'sendRequest', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['blink.user_timing'], 'navigationStart')) {
     return normalizeEvent(event, {'name': name});
   }
   return null;  // nothing useful in this event
 }
开发者ID:4vanger,项目名称:angular,代码行数:41,代码来源:chrome_driver_extension.ts


示例9: createExtension

 function createExtension(perfRecords = null): WebDriverExtension {
   if (isBlank(perfRecords)) {
     perfRecords = [];
   }
   log = [];
   extension = ReflectiveInjector.resolveAndCreate([
                                   IOsDriverExtension.PROVIDERS,
                                   {provide: WebDriverAdapter, useValue: new MockDriverAdapter(log, perfRecords)}
                                 ])
                   .get(IOsDriverExtension);
   return extension;
 }
开发者ID:4vanger,项目名称:angular,代码行数:12,代码来源:ios_driver_extension_spec.ts


示例10: BaseException

 (children: WebDriverExtension[], capabilities) => {
   var delegate;
   children.forEach(extension => {
     if (extension.supports(capabilities)) {
       delegate = extension;
     }
   });
   if (isBlank(delegate)) {
     throw new BaseException('Could not find a delegate for given capabilities!');
   }
   return delegate;
 },
开发者ID:0xJoKe,项目名称:angular,代码行数:12,代码来源:web_driver_extension.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript facade.isPresent函数代码示例发布时间:2022-05-28
下一篇:
TypeScript elements.createCustomElement函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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