本文整理汇总了TypeScript中@utils/is.is_Function函数的典型用法代码示例。如果您正苦于以下问题:TypeScript is_Function函数的具体用法?TypeScript is_Function怎么用?TypeScript is_Function使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_Function函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: build_Static
function build_Static(static_, node, model, ctx, container, ctr, children) {
var Ctor = static_.__Ctor,
wasRendered = false,
elements,
compo,
clone;
if (Ctor != null) {
clone = new Ctor(node, ctr);
}
else {
clone = static_;
for (var key in node)
clone[key] = node[key];
clone.parent = ctr;
}
var attr = clone.attr;
if (attr != null) {
for (var key in attr) {
if (typeof attr[key] === 'function')
attr[key] = attr[key]('attr', model, ctx, container, ctr, key);
}
}
if (is_Function(clone.renderStart)) {
clone.renderStart(model, ctx, container, ctr, children);
}
clone.ID = ++BuilderData.id;
compo_addChild(ctr, clone);
var i = ctr.components.length - 1;
if (is_Function(clone.render)){
wasRendered = true;
elements = clone.render(model, ctx, container, ctr, children);
arr_pushMany(children, elements);
if (is_Function(clone.renderEnd)) {
compo = clone.renderEnd(elements, model, ctx, container, ctr);
if (compo != null) {
// overriden
ctr.components[i] = compo;
compo.components = clone.components == null
? ctr.components.splice(i + 1)
: clone.components
;
}
}
}
return wasRendered === true ? null : clone;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:55,代码来源:build_component.ts
示例2: customStatement_register
export function customStatement_register (name, handler){
//@TODO should it be not allowed to override system statements, if, switch?
custom_Statements[name] = is_Function(handler)
? { render: handler }
: handler
;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:statement.ts
示例3: dfr_isBusy
export function dfr_isBusy(dfr) {
if (dfr == null || typeof dfr.then !== 'function') return false;
// Class.Deferred
if (is_Function(dfr.isBusy)) return dfr.isBusy();
// jQuery Deferred
if (is_Function(dfr.state)) return dfr.state() === 'pending';
if (dfr instanceof Promise) {
return true;
}
log_warn('Class, jQuery or native promise expected');
return false;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:16,代码来源:dfr.ts
示例4: function
constructor: function(compo, expression) {
this.error = null;
this.exports = [];
this.onResolve = this.onResolve.bind(this);
this.onReject = this.onReject.bind(this);
var arr = expression_evalStatements(expression, compo.model, null, compo);
var imax = arr.length,
i = -1;
this.await_ = imax;
while(++i < imax) {
var x = arr[i];
if (x == null || is_Function(x.then) === false) {
this.await_--;
this.exports.push(x);
continue;
}
x.then(this.onResolve, this.onReject);
}
if (this.await_ === 0) {
this.resolve(this.exports);
}
},
开发者ID:atmajs,项目名称:MaskJS,代码行数:25,代码来源:await.ts
示例5: selector_match
export function selector_match (node, selector, type?) {
if (node == null)
return false;
if (is_String(selector)) {
if (type == null)
type = Dom[node.compoName ? 'CONTROLLER' : 'SET'];
selector = selector_parse(selector, type);
}
var obj = selector.prop ? node[selector.prop] : node;
if (obj == null)
return false;
if (is_Function(selector.selector))
return selector.selector(obj[selector.key]);
// regexp
if (typeof selector.selector !== 'string' && selector.selector.test != null)
return selector.selector.test(obj[selector.key]);
// string | int
/* jshint eqeqeq: false */
return obj[selector.key] == selector.selector;
/* jshint eqeqeq: true */
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:27,代码来源:selector.ts
示例6: function
processNode: function(node) {
var stream = this.stream;
if (is_Function(node.stringify)) {
var str = node.stringify(stream);
if (str != null) {
stream.print('<mask>');
stream.write(str);
stream.print('</mask>');
}
return;
}
if (is_String(node.content)) {
stream.print(node.content);
return;
}
if (is_Function(node.content)){
stream.print(node.content());
return;
}
if (node.type === Dom.FRAGMENT) {
this.process(node);
return;
}
stream.print('<' + node.tagName);
this.processAttr(node);
if (isEmpty(node)) {
if (html_isVoid(node)) {
stream.print('>');
return;
}
if (html_isSemiVoid(node)) {
stream.print('/>');
return;
}
stream.print('></' + node.tagName + '>');
return;
}
stream.print('>');
this.process(node.nodes);
stream.print('</' + node.tagName + '>');
},
开发者ID:atmajs,项目名称:MaskJS,代码行数:43,代码来源:stringify.ts
示例7: function
injectableClass: function(mix){
if (is_Function(mix)) {
return createInjectableClassWrapper(mix, null);
}
if (is_Array(mix)) {
return function (Ctor) {
return createInjectableClassWrapper(Ctor, mix);
};
}
throw Error('Invalid injectable args');
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:Di.ts
示例8: _toTimingFn
function _toTimingFn(str) {
if (str == null) {
return Fns.linear;
}
var fn = Fns[str];
if (is_Function(fn) === false) {
log_error('Unsupported timing:' + str + '. Available:' + Object.keys(Fns).join(','));
return Fns.linear;
}
return fn;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:Tween.ts
示例9: function
return function(val){
if (current_ === val) {
return;
}
current_ = val;
var fn = ctr.setAttribute;
if (is_Function(fn)) {
fn.call(ctr, attrName, val);
return;
}
ctr.attr[attrName] = val;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:12,代码来源:bind.ts
示例10: listeners_on
listeners_on('config', function (config) {
var modules = config.modules;
if (modules == null) {
return;
}
var fn = Loaders[modules];
if (is_Function(fn) === false) {
log_warn('Module system is not supported: ' + modules);
return;
}
fn();
});
开发者ID:atmajs,项目名称:MaskJS,代码行数:12,代码来源:loaders.ts
注:本文中的@utils/is.is_Function函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论