當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript lodash.isFunction函數代碼示例

本文整理匯總了TypeScript中lodash.isFunction函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isFunction函數的具體用法?TypeScript isFunction怎麽用?TypeScript isFunction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了isFunction函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: prepareConfig

  prepareConfig (ns: string = '', defaultConfig: any = {}): any {
    if (isFunction(defaultConfig)) {
      defaultConfig = defaultConfig(this.app)
    }

    if (ns) {
      return Object.assign(defaultConfig, this.app.config[ns], this.options)
    } else {
      return Object.assign(defaultConfig, this.options)
    }
  }
開發者ID:Magnetjs,項目名稱:magnet-core,代碼行數:11,代碼來源:module.ts

示例2: validate

    static validate(filter, value): any {
        if (!_.isFunction(filter)) {
            throw new Error('The `filter` property must be set.');
        }

        if (_.isNil(value)) {
            return value;
        }

        return filter(value);
    }
開發者ID:vruden,項目名稱:node-validator,代碼行數:11,代碼來源:filter-validator.ts

示例3:

    router.use(wsConfigs.API.GET_CLIENT_BEFOREUNLOAD, (req: express.Request, res: express.Response, next: express.NextFunction) => {

      if (_.isFunction(this.onDriverEvent)) {

        this.onDriverEvent("beforeunload", req);
        this.onEventInvoker("beforeunload", req);

      }

      routesEvents.beforeUnload(req, res, next);
    });
開發者ID:thehachez,項目名稱:maduk,代碼行數:11,代碼來源:app.ts

示例4: function

 data: function(data:any){
   if(output.data){
     output.data += data.toString()
   }else{
     output.data = data.toString()
   }
   if(_.isFunction(options.events.log)){
     var logs:string = data.toString().toLowerCase().trim();
     options.events.log.call(output, logs);
   }
 },
開發者ID:carlosmarte,項目名稱:console-app,代碼行數:11,代碼來源:run.ts

示例5: simulateBeforeSend

function simulateBeforeSend(url: string, settings: any) {
    const xhrMockInBeforeSend = {
        setRequestHeader(key: string, value: string) {
            _set(settings, ['headers', key], value);
        }
    };

    if (isFunction(settings.beforeSend)) {
        settings.beforeSend(xhrMockInBeforeSend, url);
    }
}
開發者ID:gooddata,項目名稱:gooddata-js,代碼行數:11,代碼來源:xhr.ts

示例6: handleCellSelect

    private handleCellSelect(state:GigaState, action:ToggleCellSelectAction):GigaState {

        if (_.isFunction(this.props.onCellClick)) {
            if (!this.props.onCellClick(action.row, action.column))
                return state; // will not emit state mutation event
            else
                return _.clone(state); // will emit state mutation event
        } else
            return state;

    }
開發者ID:wenjiechen,項目名稱:GigaGrid,代碼行數:11,代碼來源:GigaStore.ts

示例7: return

 return (control: AbstractControl): ValidationErrors | null => {
   // Check if all prerequisites matches.
   if (!Object.keys(prerequisites).every((key) => {
     return (control.parent && control.parent.get(key).value === prerequisites[key]);
   })) {
     return null;
   }
   const success = _.isFunction(condition) ? condition.call(condition, control.value) :
     isEmptyInputValue(control.value);
   return success ? {'required': true} : null;
 };
開發者ID:Abhishekvrshny,項目名稱:ceph,代碼行數:11,代碼來源:cd-validators.ts

示例8: Controller

export function Controller(strOrFunc) {
    if (_.isString(strOrFunc)) {
        return function (target) {
            app.controller(strOrFunc, target);
        }
    } else if (_.isFunction(strOrFunc)) {
        app.controller(strOrFunc.name, strOrFunc);
    } else {
        throw Error("@Controller 必須標注在 function or Class");
    }
}
開發者ID:baihuibo,項目名稱:idsp-base-web-seed,代碼行數:11,代碼來源:annotation.ts

示例9:

          .forEach(key => {
            const v = mapping;
            if (_.isUndefined(v) || _.isFunction(v)) {
              throw `


            Class: '${target.name}'
[ng2rest] Bad mapping value for path: ${key} , please use type: <string> or [<string>]
`;

            }
          });
開發者ID:darekf77,項目名稱:ng2-rest,代碼行數:12,代碼來源:mapping.ts

示例10:

		_.each(filters, (filter: any /* filters.IFilterWithCounts */): void => {
			if (_.isFunction(filter.updateOptionCounts)) {
				var otherFiltersApplied: IWrappedItem<TDataType>[] = _.filter(wrappedData, (item: IWrappedItem<TDataType>): boolean => {
					// Omit the true or false of the current filter an
					//  only filter out items removed by other filters
					var filterData: any = _.omit(item.filterData, filter.type); //*filterData
					return _.every(_.values(filterData));
				});

				filter.updateOptionCounts(this.unwrapData(otherFiltersApplied));
			}
		});
開發者ID:JamieBowen,項目名稱:TypeScript-Angular-Components,代碼行數:12,代碼來源:dataSourceProcessor.service.ts


注:本文中的lodash.isFunction函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。