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