當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。