当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript is.is_Object函数代码示例

本文整理汇总了TypeScript中@utils/is.is_Object函数的典型用法代码示例。如果您正苦于以下问题:TypeScript is_Object函数的具体用法?TypeScript is_Object怎么用?TypeScript is_Object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_Object函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: mask_config

export function mask_config (a?, b?, c?) {
	var args = arguments,
		length = args.length
	if (length === 0) {
		return __cfg;
	}
	if (length === 1) {
		let x = args[0]
		if (is_Object(x)) {
			obj_extend(__cfg, x);
			listeners_emit('config', x);
			return;
		}
		if (is_String(x)) {
			return obj_getProperty(__cfg, x);
		}
	}
	if (length === 2) {
		var prop = args[0];
		if (obj_hasProperty(__cfg, prop) === false) {
			log_warn('Unknown configuration property', prop);
		}
		let x = {};
		obj_setProperty(x    , prop, args[1]);
		obj_setProperty(__cfg, prop, args[1]);
		listeners_emit('config', x);
		return;
	}
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:29,代码来源:config.ts

示例2: getSelfMutators

export function getSelfMutators(obj) {
    if (is_Object(obj) === false) {
        return null;
    }
    if (is_ArrayLike(obj)) {
        return MUTATORS_.Array;
    }
    if (is_Date(obj)) {
        return MUTATORS_.Date;
    }
    return null;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:12,代码来源:Mutators.ts

示例3: u_setOption

export function u_setOption (options, key, val) {
    if (key === 'base' || key === 'nsBase') {
        var path = path_normalize(val);
        if (path[path.length - 1] !== '/') {
            path += '/';
        }
        // Do not resolve root, as it will be resolved by base later
        // @NextIteration: remove also path_resolveRoot, use instead resolveCurrent
        // if (path[0] === '/') {
        // 	path = path_combine(path_resolveRoot(), path);
        // }
        options[key] = path;
        return this;
    }
    var current = obj_getProperty(options, key);
    if (is_Object(current) && is_Object(val)) {
        obj_extend(current, val);
        return this;
    }
    obj_setProperty(options, key, val);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:21,代码来源:utils.ts

示例4: m_cfg

export function m_cfg(mix, val){
    if (arguments.length === 1) {
        if (is_String(mix)) {
            return obj_getProperty(_opts, mix);
        }
        if (is_Object(mix)) {
            for (var key in mix) {
                u_setOption(_opts, key, mix[key]);
            }
        }
        return this;
    }
    u_setOption(_opts, mix, val);
    return this;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:config.ts

示例5: _wrapper_CompoBuilder

export function _wrapper_CompoBuilder (decoNode, deco, builderFn) {
    let beforeRender, afterRender, decoCtx;

    if (is_Function(deco)) {
        beforeRender = deco;
    } else if (is_Object(deco)) {
        beforeRender = deco.beforeRender;
        afterRender = deco.afterRender;
        decoCtx = deco;
    }
    if (beforeRender || afterRender) {
        return create(decoCtx, beforeRender, afterRender, builderFn);
    }
    error_withNode('Invalid node decorator', decoNode);
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:wrappers.ts

示例6: mask_run

export function mask_run (){
		if (_state === 0) {
			_state = _state_All
		}
		var args = _Array_slice.call(arguments),
			model, ctx, el, Ctor;

		var imax = args.length,
			i = -1,
			mix;
		while ( ++i < imax ) {
			mix = args[i];
			if (mix instanceof Node) {
				el = mix;
				continue;
			}
			if (is_Function(mix)) {
				Ctor = mix;
				continue;
			}
			if (is_Object(mix)) {
				if (model == null) {
					model = mix;
					continue;
				}
				ctx = mix;
			}
		}

		if (el == null)
			el = document.body;
		if (Ctor == null)
			Ctor = Compo;
		if (model == null) {
			model = {};
		}

		var ctr = new Ctor(null, model, ctx, el);
		return _run(model, ctx, el, ctr);
	};
开发者ID:atmajs,项目名称:MaskJS,代码行数:40,代码来源:run.ts

示例7: ani_updateAttr

export function ani_updateAttr(compo, key, prop, val, meta) {
		var transition = compo.attr[key + '-transition'];
		if (transition == null && is_Object(meta)) {
			transition = meta.transition;
		}
		if (transition == null) {
			compo.attr[key] = val;
			if (prop != null) {
				compo[prop] = val;
			}
			_refresh(compo);
			return;
		}
		var tweens = compo.__tweens;
		if (tweens == null) {
			tweens = compo.__tweens = new TweenManager(compo);
		}

		var start = compo[prop];
		var end = val;
		tweens.start(key, prop, start, end, transition);
	};
开发者ID:atmajs,项目名称:MaskJS,代码行数:22,代码来源:ani.ts

示例8: fn_fromModel

function fn_fromModel(model, prop) {
    if (is_Object(model) === false) {
        return null;
    }
    var Validate = model.Validate;
    if (Validate != null) {
        var fn = null;
        if (is_Function(fn = Validate)) {
            return fn;
        }
        if (is_Function(fn = Validate[prop])) {
            return fn;
        }
    }
    
    var i = prop.indexOf('.');
    if (i !== -1) {
        return fn_fromModel(
            model[prop.substring(0, i)], prop.substring(i+1)
        );
    }
    return null;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:23,代码来源:ValidatorProvider.ts

示例9: compo_prototype


//.........这里部分代码省略.........
			var x = nodes[i];
			if (x == null) {
				continue;
			}
			if (x.type === Dom.DECORATOR) {
				var start = i;
				i = Decorator.goToNode(nodes, i, imax);
				decorators = _Array_slice.call(nodes, start, i);
				x = nodes[i];
			}
			
			var name = x.tagName;
			if ('function' === name) {
				if (name === 'constructor') {
					Proto.constructor = joinFns([Proto.constructor, x.fn]);
					continue;
				}
				var fn = x.fn;
				Proto[x.name] = fn;
				if (x.decorators != null) {
					var result = Decorator.wrapMethod(x.decorators, fn, Proto, x.name, model, null, owner);
					if (is_Function(result)) {
						Proto[x.name] = result;
					}
				}
				if (x.flagSelf) {
					selfFns = selfFns || [];
					selfFns.push(x.name);
				}
				if (x.flagStatic) {
					if (Proto.meta.statics == null) {
						Proto.meta.statics = {};
					}
					Proto.meta.statics[x.name] = fn;
				}
				continue;
			}
			if ('slot' === name || 'event' === name) {
				if ('event' === name && Proto.tagName != null) {
					// bind the event later via the component
					arr.push(x);
					continue;
				}
				var type = name + 's';
				var fns = Proto[type];
				if (fns == null) {
					fns = Proto[type] = {};
				}
				fns[x.name] = x.flagPrivate ? slot_privateWrap(x.fn) : x.fn;
				if (x.decorators != null) {
					var result = Decorator.wrapMethod(x.decorators, x.fn, fns, x.name, model, null, owner);
					if (is_Function(result)) {
						fns[x.name] = result;
					}
				}
				continue;
			}
			if ('pipe' === name) {
				custom_Tags.pipe.attach(x, Proto);
				continue;
			}
			if ('define' === name || 'let' === name) {
				var register = name === 'define'
					? Define.registerGlobal
					: Define.registerScoped;
				register(x, model, Proto);
				continue;
			}
			if ('var' === name) {
				var obj = x.getObject(model, null, owner),
					key, val;
				for(key in obj) {
					val = obj[key];
					if (key === 'meta' || key === 'model' || key === 'attr' || key === 'compos') {
						Proto[key] = obj_extend(Proto[key], val);
						continue;
					}
					if (key === 'scope') {
						if (is_Object(val)) {
							Proto.scope = obj_extend(Proto.scope, val);
							continue;
						}
					}
					var scope = Proto.scope;
					if (scope == null) {
						Proto.scope = scope = {};
					}
					scope[key] = val;
					Proto[key] = val;
				}
				continue;
			}

			if (decorators != null) {
				arr.push.apply(arr, decorators);
			}
			arr.push(x);
		}		
		return Proto;
	}
开发者ID:atmajs,项目名称:MaskJS,代码行数:101,代码来源:Define.ts

示例10: define

import { is_Function, is_Object } from '@utils/is';
import { error_withNode } from '@core/util/reporters';
import {
    _wrapMany,
    _wrapper_NodeBuilder,
    _wrapper_CompoBuilder,
    _wrapper_Fn
} from './wrappers';
import { _getDecoType } from './utils';
import { _store } from './store';
import { Methods } from '../methods/exports';

export const Decorator = {
    getDecoType: _getDecoType,
    define(key, mix) {
        if (is_Object(mix)) {
            mix = class_create(mix);
            mix.isFactory = true;
        }
        if (is_Function(mix) && mix.isFactory) {
            // Wrap the function, as it could be a class, and decorator expression cann`t contain 'new' keyword.
            _store[key] = function() {
                return new (mix.bind.apply(
                    mix,
                    [null].concat(_Array_slice.call(arguments))
                ))();
            };
            _store[key].isFactory = true;
            return;
        }
        _store[key] = mix;
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:exports.ts


注:本文中的@utils/is.is_Object函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。