UNPKG

582 BJavaScriptView Raw
1// constructor
2function UserAgent() {}
3// public
4UserAgent.prototype.userAgent = 'aws-amplify/0.1.x js';
5
6export const appendToCognitoUserAgent = content => {
7 if (!content) {
8 return;
9 }
10 if (
11 UserAgent.prototype.userAgent &&
12 !UserAgent.prototype.userAgent.includes(content)
13 ) {
14 UserAgent.prototype.userAgent = UserAgent.prototype.userAgent.concat(
15 ' ',
16 content
17 );
18 }
19 if (!UserAgent.prototype.userAgent || UserAgent.prototype.userAgent === '') {
20 UserAgent.prototype.userAgent = content;
21 }
22};
23
24// class for defining the amzn user-agent
25export default UserAgent;