本文整理汇总了TypeScript中lodash.merge类的典型用法代码示例。如果您正苦于以下问题:TypeScript merge类的具体用法?TypeScript merge怎么用?TypeScript merge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了merge类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setConfig
public setConfig(taskConfig: TASK_CONFIG): void {
/* tslint:disable:typedef */
let merge = require('lodash.merge');
/* tslint:enable:typedef */
this.taskConfig = merge({}, this.taskConfig, taskConfig);
}
示例2: it
it("will reject expired incoming messages", function (done) {
const confirmMethod = simple.mock(AMQPSubscriberAdapter.prototype,
"confirmProcessedMessage");
const rejectMethod = simple.mock(AMQPSubscriberAdapter.prototype,
"rejectMessage");
const onMessageMethod = simple.mock();
consumer.on("message", onMessageMethod);
const expiredMessage = merge({}, fixtures.consumer_basic, {
meta: {ttl: 10000},
});
publisher.publish([
fixtures.consumer_basic,
expiredMessage,
fixtures.consumer_basic,
], function (err) {
if (err) return done(err);
setTimeout(function () {
expect(onMessageMethod.callCount).equals(2);
expect(onMessageMethod.calls[0].arg).deep.equals(fixtures.consumer_basic);
expect(onMessageMethod.calls[1].arg).deep.equals(fixtures.consumer_basic);
expect(rejectMethod.callCount).equals(1);
expect(confirmMethod.callCount).equals(2);
expect(rejectMethod.lastCall.k).above(confirmMethod.calls[0].k);
expect(rejectMethod.lastCall.k).below(confirmMethod.calls[1].k);
done();
}, 100);
});
});
示例3: updateValidatorsOnDiscriminatorChange
public updateValidatorsOnDiscriminatorChange(discriminatorValue: any, swaggerDef, fullSwaggerDef) {
var allOf = fullSwaggerDef.api.definitions[discriminatorValue].allOf;
this._validators = {};
var newSwaggerDef = _.merge.apply(this, [{}].concat(allOf));
attachStaticValidators(this, newSwaggerDef);
}
示例4: createComponent
public createComponent (createOptions?: any): void {
let options = {
template: this.template,
components: this.components
}
if (createOptions) merge(options, createOptions)
this.vm = new Vue(options).$mount()
}
示例5: function
channelManager.createRawConsumer = function (topic, options) {
let a = getAdapter();
let subscriberConfig = merge({
channel: helpers.validatedTopic(topic),
}, adapterConfig, options);
return a.Subscribe(subscriberConfig);
};
示例6: constructor
constructor(authToken: string | undefined = undefined, requireAuth: boolean = false, options: GitHubAPI.Options = {}) {
this.options = merge(
options,
{ headers: { 'user-agent': 'Electron Forge' } },
);
if (authToken) {
this.token = authToken;
} else if (process.env.GITHUB_TOKEN) {
this.token = process.env.GITHUB_TOKEN;
} else if (requireAuth) {
throw 'Please set GITHUB_TOKEN in your environment to access these features';
}
}
示例7: setConfig
export function setConfig(config: IBuildConfig) {
let merge = require('lodash.merge');
_buildConfig = merge({}, _buildConfig, config);
}
示例8: merge
export function merge(...args: any[]): DefineAttributes {
return lmerge.apply(null, args.reverse());
}