本文整理匯總了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;
};
示例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;
}
}
示例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);
}
示例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;
}
示例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);
};
},
示例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;
}
示例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;
}
示例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;
},
示例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);
};
示例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);
}
}
};