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


TypeScript underscore.isUndefined函数代码示例

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


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

示例1: function

  'ifattr-type': function (typename: string, attr: string, context: HandlebarsContext, options) {
    let hif = Handlebars.helpers['if'];

    let ntObj = context.types[typename];
    if (_.isUndefined(ntObj)) return hif.call(this, false, options);
    if (_.isUndefined(ntObj.attrs)) return hif.call(this, false, options);

    return hif.call(this, hb_attrfind(ntObj.attrs, attr), options);
  },
开发者ID:do5,项目名称:mcgen,代码行数:9,代码来源:global-handler-hbs.ts

示例2: detectFloat

		this.forEach((el: any) => {
			// console.log('getRowTypes', el);
			// let float = parseFloat(el);	// does not handle 1.000,12 well
			let float = detectFloat(el);

			let date = Date.parse(el);
			let isDate = !!date && el.indexOf(',') == -1;	// dates are without ","
			let isEmpty = _.isNull(el)
				|| _.isUndefined(el)
				|| el == '';
			let commas = 0;
			if (_.isString(el)) {
				commas = el.split(',').length - 1;
			}
			let elWithoutEUR = (el || '').replace('EUR', '').trim();
			let onlyNumbers = /^[\-,\.\d]+$/.test(elWithoutEUR);
			if (float && !isDate && commas == 1 && onlyNumbers) {
				types.push('number');
			} else if (isDate) {
				types.push('date');
			} else if (isEmpty) {
				types.push('null');
			} else {
				types.push('string');
			}
		});
开发者ID:spidgorny,项目名称:umsaetze,代码行数:26,代码来源:Row.ts

示例3: typeHandler

  public static typeHandler(prop, hal, entityName, propType: Entity): boolean {

     if (prop.type === 'string' && prop.format === 'uri') {
       // This is a resource. Let's find it:
       let propertyHal = this.findDeep(hal, 'name', entityName);
       let propertyUrl = propertyHal.rt.split('#')[0];

       // Since we don't have all the entities in the ResourceMap at this point,
       // Create an empty entity with just the URL. It should be enough to attach
       // the real entity later.
       propType.isResource = true;
       propType.url = propertyUrl;

       return true;
     } else if (!_.isUndefined(prop.$ref)) {
         let complexEntityName = prop.$ref.split('/').pop();
         propType.name = complexEntityName;
         propType.isResource = false;
         propType.url = complexEntityName;

        return true;
     }

     return false;
   };
开发者ID:davidstellini,项目名称:generator-tsdatalayer,代码行数:25,代码来源:TypeHandler.ts

示例4:

_.each(Setting.templates, (val, key) => {
  if (!_.isEmpty(Setting.mp_idsTemplate) && _.isUndefined(Setting.mp_idsTemplate[val.getId()])) return;

  $.consoleProccess(`Proccess '${val.getId()}' `);
  if (!val.proccess(model, Setting.mp_outdir)) {
    $.consoleError(`Error validation ${val.getLastDisplayError()}`);
    process.exit(-1);
  }
});
开发者ID:do5,项目名称:mcgen,代码行数:9,代码来源:mcgen.ts

示例5: return

 vm.loadouts = vm.loadouts.filter((loadout: Loadout) => {
   return (vm.store.destinyVersion === 2
     ? loadout.destinyVersion === 2 : loadout.destinyVersion !== 2) &&
     (_.isUndefined(loadout.platform) ||
           loadout.platform === platform.platformLabel) &&
     (vm.classTypeId === -1 ||
      loadout.classType === -1 ||
      loadout.classType === vm.classTypeId);
 });
开发者ID:delphiactual,项目名称:DIM,代码行数:9,代码来源:loadout-popup.component.ts

示例6:

    _.each(model.properties, p => {
        if (!this.isNativeType(p.type.name) ) {
          // No duplicates by "Type" key

          if (_.isUndefined(_.find(deps, dep => {
           return  dep.type.name === p.type.name;
         }))) {
            deps.push(p);
         }
        }
    });
开发者ID:davidstellini,项目名称:generator-tsdatalayer,代码行数:11,代码来源:ModelUtils.ts

示例7: getOptions

	private getOptions() {
		var currentUser = window.localStorage.getItem('currentUser');
		
		if (_.isUndefined(currentUser) || _.isNull(currentUser)) {
			return null;
		} else {
			var token = JSON.parse(currentUser).token;
			let headers = new Headers({ 'Authorization': 'JWT ' + token});
			let options = new RequestOptions({ headers: headers });
			return options;
		}
	}
开发者ID:openevocracy,项目名称:openevocracy,代码行数:12,代码来源:http-manager.service.ts


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