本文整理汇总了TypeScript中@utils/obj.obj_extendDefaults函数的典型用法代码示例。如果您正苦于以下问题:TypeScript obj_extendDefaults函数的具体用法?TypeScript obj_extendDefaults怎么用?TypeScript obj_extendDefaults使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了obj_extendDefaults函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: compo_create
export function compo_create(arguments_: any[]) {
var argLength = arguments_.length,
Proto = arguments_[argLength - 1],
Ctor,
hasBase;
if (argLength > 1)
hasBase = compo_inherit(
Proto,
_Array_slice.call(arguments_, 0, argLength - 1)
);
if (Proto == null) Proto = {};
var include = _resolve_External('include');
if (include != null) Proto.__resource = include.url;
compo_prepairProperties(Proto);
Ctor = Proto.hasOwnProperty('constructor') ? Proto.constructor : null;
Ctor = compo_createConstructor(Ctor, Proto, hasBase);
obj_extendDefaults(Proto, CompoProto);
Ctor.prototype = Proto;
Proto = null;
return Ctor;
}
示例2: mask_stringify
export function mask_stringify (input, opts?) {
if (input == null)
return '';
if (typeof input === 'string')
input = parser_parse(input);
if (opts == null) {
opts = obj_create(defaultOptions);
} else if (typeof opts === 'number'){
var indent = opts;
opts = obj_create(defaultOptions);
opts.indent = indent;
opts.minify = indent === 0;
} else{
opts = obj_extendDefaults(opts, defaultOptions);
if (opts.indent > 0) {
opts.minify = false;
}
if (opts.minify === true) {
opts.indent = 0;
}
}
return new Stream(input, opts).toString();
};
示例3: tools_getDependencies
export function tools_getDependencies (template, path, opts_?: { deep?: boolean, flattern?: boolean }){
var opts = obj_extendDefaults(opts_, defaultOptions);
var dfr = new class_Dfr;
var ast = typeof template === 'string'
? parser_parse(template)
: template
;
return get(ast, path, opts, dfr);
};
示例4: tools_build
export function tools_build (template, path, opts_?){
var opts = obj_extendDefaults(opts_, optionsDefault);
return class_Dfr.run(function(resolve, reject){
tools_getDependencies(template, path, { flattern: true })
.fail(reject)
.done(function(deps){
build(deps, opts, complete, reject);
});
function complete (out) {
out.mask += '\n' + template;
resolve(out);
}
});
};