本文整理汇总了TypeScript中lodash.assignIn函数的典型用法代码示例。如果您正苦于以下问题:TypeScript assignIn函数的具体用法?TypeScript assignIn怎么用?TypeScript assignIn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assignIn函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(user?:{lastConnection:string,username:string,password:string,role:Profile}) {
this.rememberMe = false;
this.roles = [];
if(user) {
_.assignIn(this, user);
}
}
示例2: return
return ((params: busboyPipe.FilePipeParams) : busboyPipe.WriteStreamInfo => {
let s3Params: any = {
"Bucket": options.Bucket,
"Key": options.KeyMaker(params)
};
if (options.additonalS3Options) s3Params = _.assignIn(s3Params, options.additonalS3Options);
let upload: stream.Writable = s3Stream.upload(s3Params);
upload.on('uploaded', (details:any) => {
upload.emit('close');
});
return {stream: upload, streamInfo: s3Params};
});
示例3: function
$scope.$on('onTimeframeChange', function (event, timeframe) {
let query;
if (that.widget.chart.request.query) {
query = that.widget.chart.request.query;
}
// Associate the new timeframe to the chart request
_.assignIn(that.widget.chart.request, {
interval: timeframe.interval,
from: timeframe.from,
to: timeframe.to,
query: query,
additionalQuery: that.widget.chart.request.additionalQuery
});
that.reload();
});
示例4: setTimeout
// api's $M method
$M(pathname: string, options?: IMessageClientOptions, headers?: $dr.HTTPHeaders) : mc.IMessageClient {
options = options || defaultMsgClientOptions;
options = _.assignIn({}, defaultMsgClientOptions, options);
let eventApiRoute = this.mount(pathname);
let client = new mc.MessageClient(eventApiRoute.$J.bind(eventApiRoute));
let retryConnect = () => {
this.$E(pathname, headers)
.then((ret: $dr.I$EReturn) => {
client.attachEventSource(ret);
}).catch((err: any) => {
client.emit('error', err);
});
};
client.on('error', (err:any) => {
setTimeout(retryConnect, options.reconnetIntervalMS);
});
retryConnect();
return client;
}
示例5: getAccessFromCode
getAccessFromCode(client_id:string, params: auth_client.IGetAccessFromCodeParams, done:(err:any, access: oauth2.Access) => void) : void {
let data = this.extendParams(client_id, params);
let ret = generateBearerAccessTokens(true);
data = _.assignIn(data, ret);
this.execute('[dbo].[stp_AuthGetAccessFromCode]', data, (err:any, recordsets:any[]) => {
if (err)
done(err, null);
else {
let err:IError = recordsets[0][0];
if (err.error)
done(err, null);
else {
let access: oauth2.Access = recordsets[1][0];
//console.log(JSON.stringify(access));
done(null, access);
}
}
});
}
示例6: it
it('should prepare data if RGW', () => {
const newData = _.assignIn(component.selection.first(), {
fsal: {
name: 'RGW',
rgw_user_id: 'rgw_user_id'
}
});
component.selection.selected = [newData];
component.selection.update();
component.ngOnChanges();
expect(component.data).toEqual({
'Access Type': 'RW',
Cluster: 'cluster1',
Daemons: ['node1', 'node2'],
'NFS Protocol': ['NFSv3', 'NFSv4'],
'Object Gateway User': 'rgw_user_id',
Path: '/qwe',
Pseudo: '/qwe',
Squash: 'no_root_squash',
'Storage Backend': 'Object Gateway',
Transport: ['TCP', 'UDP']
});
});
示例7: getHeaders
// returns the headers to be used for the API call
public getHeaders(additionalHeaders?: {[field:string]:string}) : any {
let headers = additionalHeaders || {};
let authHeader = oauth2.Utils.getAuthorizationHeaderFormAccessToken(this.access);
if (authHeader) _.assignIn(headers, {'Authorization' : authHeader});
return (JSON.stringify(headers) === '{}' ? null : headers);
}
示例8: extendParams
private extendParams(client_id:string, params:any) : any { // added client_id to the params
return _.assignIn({client_id}, params);
}
示例9: constructor
constructor(token:{secretKey:string,token:string,securityLevel:string}) {
_.assignIn(this, token);
}