• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript obj.obj_extend函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cache_toMap

export function cache_toMap  () {
    var out = {};
    for (var x in _cache) {
        obj_extend(out, _cache[x]);
    }
    return out;
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:cache.ts


示例2: 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


示例3: builder_setCompoModel

export function builder_setCompoModel(compo, model, ctx, ctr) {
    var readModel = (compo.meta != null && compo.meta.readArguments) || null;
    var argsModel =
        readModel == null ? null : readModel(compo.expression, model, ctx, ctr);
    if (compo.model != null) {
        return obj_extend(compo.model, argsModel);
    }
    return (compo.model = argsModel || model);
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:9,代码来源:util.ts


示例4: _mergeComponent

function _mergeComponent(node, placeholders, tmplNode, clonedParent) {
    if (node.nodes == null)
        return node;

    var cloned = new Dom.Component;
    obj_extend(cloned, node);
    cloned.nodes = _merge(cloned.nodes, placeholders, tmplNode, clonedParent);
    return cloned;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:9,代码来源:merge.ts


示例5: function

 pause: function(compo, ctx) {
     if (ctx != null) {
         if (ctx.defers == null) {
             // async components
             ctx.defers = [];
         }
         if (ctx.resolve == null) {
             obj_extend(ctx, class_Dfr.prototype);
         }
         ctx.async = true;
         ctx.defers.push(compo);
         ctx.defer();
     }
     obj_extend(compo, CompoProto);
     var slots = Slots.wrap(compo);
     return function() {
         // Restore only signals in case smth. will be emitted during resume
         Slots.unwrap(compo, slots, true, false);
         CompoStaticsAsync.resume(compo, ctx);
         Slots.unwrap(compo, slots, false, true);
     };
 },
开发者ID:atmajs,项目名称:MaskJS,代码行数:22,代码来源:async.ts


示例6: _createExports

function _createExports(nodes, model, module) {
    var exports = module.exports,
        items = module.importItems,
        getHandler = _module_getHandlerDelegate(module);

    var i = -1,
        imax = items.length;
    while (++i < imax) {
        var x = items[i];
        if (x.registerScope) {
            x.registerScope(module);
        }
    }

    var i = -1,
        imax = nodes.length;
    while (++i < imax) {
        var node = nodes[i];
        var name = node.tagName;
        if (name === 'define' || name === 'let') {
            var Base = {
                getHandler: _fn_wrap(customTag_Compo_getHandler, getHandler),
                getModule: _module_getModuleDelegate(module),
                location: module.location
            };
            var Ctor = Define.create(node, model, module, Base);
            var Proto = Ctor.prototype;
            if (Proto.scope != null || module.scope != null) {
                Proto.scope = obj_extend(Proto.scope, module.scope);
            }

            var compoName = node.name;
            if (name === 'define') {
                exports[compoName] = Ctor;
                customTag_register(compoName, Ctor);
            }
            if (name === 'let') {
                customTag_registerResolver(compoName);
            }
            exports.__handlers__[compoName] = Ctor;
        }
    }
    exports['*'] = class_create(customTag_Base, {
        getHandler: getHandler,
        location: module.location,
        nodes: exports.__nodes__,
        scope: module.scope
    });

    return exports;
}
开发者ID:atmajs,项目名称:MaskJS,代码行数:51,代码来源:ModuleMask.ts


示例7: compo_fromNode

	function compo_fromNode(node, model, ctr, Base) {
		var extends_ = node['extends'],
			args_ = node['arguments'],
			as_ = node['as'],
			tagName,
			attr;
		if (as_ != null) {
			var x = parser_parse(as_);
			tagName = x.tagName;
			attr = obj_extend(node.attr, x.attr);
		}
		
		var name = node.name,
			Proto = compo_prototype(node, name, tagName, attr, node.nodes, ctr, model, Base),
			args = compo_extends(extends_, model, ctr)
			;

		args.push(Proto);
		var Ctor = Component.create.apply(null, args);
		if (Proto.meta.statics) {
			obj_extend(Ctor, Proto.meta.statics);
		}
		return Ctor;
	}
开发者ID:atmajs,项目名称:MaskJS,代码行数:24,代码来源:Define.ts


示例8: function

		getHandlers: function(){
			var handlers = {};
			var arr = this.importItems,
				imax = arr.length,
				i = -1, import_, x;
			while ( ++i < imax ){
				import_ = arr[i];
				if (import_ !== 'mask') {
					continue;
				}
				x = import_.getHandlers();
				obj_extend(handlers, x);
			}
			return handlers;
		},
开发者ID:atmajs,项目名称:MaskJS,代码行数:15,代码来源:components.ts


示例9: 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


示例10: emitIn

    },
    emitIn (signalName, a1, a2, a3, a4){
        CompoSignals.signal.emitIn(
            this,
            signalName,
            this,
            [a1, a2, a3, a4]
        );
        return this;
    },
    $scope (path){
        return expression_eval('$scope?.' + path, null, null, this);
    },
    $eval (expr, model, ctx){
        return expression_eval(expr, model || this.model, ctx, this);
    },
    attach  (name, fn) {
        compo_attach(this, name, fn);
    },
    serializeState  () {
        if (this.scope) {
            return { scope: this.scope };
        }			
    },
    deserializeState  (bundle) {
        if (bundle != null && bundle.scope != null) {
            this.scope = obj_extend(this.scope, bundle.scope);
        }
    }
};
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:CompoProto.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript obj.obj_extendDefaults函数代码示例发布时间:2022-05-28
下一篇:
TypeScript obj.obj_create函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap