本文整理汇总了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;未经允许,请勿转载。 |
请发表评论