本文整理汇总了TypeScript中core/util/types.isFunction函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isFunction函数的具体用法?TypeScript isFunction怎么用?TypeScript isFunction使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isFunction函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _emit_callback
protected _emit_callback(): void {
if (this.callback != null) {
if (isFunction(this.callback))
this.callback(this)
else
this.callback.execute(this, {})
}
}
示例2: callback
this.connect(this.properties.selected.change, () => {
const {callback} = this
if (callback != null) {
if (isFunction(callback))
callback(this)
else
callback.execute(this)
}
})
示例3: function
const _strftime = function(t, format) {
if (isFunction(format)) {
return format(t);
} else {
// Python's datetime library augments the microsecond directive %f, which is not
// supported by the javascript library timezone: http://bigeasy.github.io/timezone/.
// Use a regular expression to replace %f directive with microseconds.
// TODO: what should we do for negative microsecond strings?
const microsecond_replacement_string = sprintf("$1%06d", _us(t));
format = format.replace(/((^|[^%])(%%)*)%f/, microsecond_replacement_string);
if (format.indexOf("%") === -1) {
// timezone seems to ignore any strings without any formatting directives,
// and just return the time argument back instead of the string argument.
// But we want the string argument, in case a user supplies a format string
// which doesn't contain a formatting directive or is only using %f.
return format;
}
return tz(t, format);
}
};