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


TypeScript utils.isEmpty函数代码示例

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


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

示例1: isEmpty

(function() {
    /** isEmpty */

    // TODO fix upstream in @types/ember https://github.com/typed-ember/ember-cli-typescript/issues/255
    // isEmpty(); // $ExpectType boolean
    isEmpty(null); // $ExpectType boolean
    isEmpty(undefined); // $ExpectType boolean
    isEmpty(''); // $ExpectType boolean
    isEmpty([]); // $ExpectType boolean
    isEmpty({ size: 0 }); // $ExpectType boolean
    isEmpty({}); // $ExpectType boolean
    isEmpty('Adam Hawkins'); // $ExpectType boolean
    isEmpty([0, 1, 2]); // $ExpectType boolean
    isEmpty('\n\t'); // $ExpectType boolean
    isEmpty('  '); // $ExpectType boolean
    isEmpty({ size: 1 }); // $ExpectType boolean
    isEmpty({ size: () => 0 }); // $ExpectType boolean
})();
开发者ID:mnahkies,项目名称:DefinitelyTyped,代码行数:18,代码来源:ember__utils-tests.ts

示例2: isEmpty

(function() {
    /** isEmpty */

    isEmpty(); // $ExpectType boolean
    isEmpty(null); // $ExpectType boolean
    isEmpty(undefined); // $ExpectType boolean
    isEmpty(''); // $ExpectType boolean
    isEmpty([]); // $ExpectType boolean
    isEmpty({ size: 0 }); // $ExpectType boolean
    isEmpty({}); // $ExpectType boolean
    isEmpty('Adam Hawkins'); // $ExpectType boolean
    isEmpty([0, 1, 2]); // $ExpectType boolean
    isEmpty('\n\t'); // $ExpectType boolean
    isEmpty('  '); // $ExpectType boolean
    isEmpty({ size: 1 }); // $ExpectType boolean
    isEmpty({ size: () => 0 }); // $ExpectType boolean
})();
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:17,代码来源:ember__utils-tests.ts

示例3: testIsEmpty

function testIsEmpty() {
    utils.isEmpty(); // $ExpectType boolean
    utils.isEmpty(''); // $ExpectType boolean
    utils.isEmpty('', ''); // $ExpectError
}
开发者ID:mnahkies,项目名称:DefinitelyTyped,代码行数:5,代码来源:utils.ts

示例4: _getFullHeadersHash

   */
  _getFullHeadersHash(headers?: Headers): Headers {
    const classHeaders = get(this, 'headers');
    return assign({}, classHeaders!, headers!);
  },

  /**
   * Created a normalized set of options from the per-request and
   * service-level settings
   */
  options(url: string, options: AJAXOptions = {}): AJAXOptions {
    options = assign({}, options);
    options.url = this._buildURL(url, options);
    options.type = options.type || 'GET';
    options.dataType = options.dataType || 'json';
    options.contentType = isEmpty(options.contentType)
      ? get(this, 'contentType')
      : options.contentType;

    if (this._shouldSendHeaders(options)) {
      options.headers = this._getFullHeadersHash(options.headers);
    } else {
      options.headers = options.headers || {};
    }

    return options;
  },

  /**
   * Build a URL for a request
   *
开发者ID:knownasilya,项目名称:ember-ajax,代码行数:31,代码来源:ajax-request.ts


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