Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Minor Angular type improvements
Update api.service.mustache

update samples
  • Loading branch information
FallenRiteMonk committed Jan 8, 2019
commit 6e4ec841a631100a76130f6af04cb0ea3ebe990d
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class {{classname}} {
{{/isOAuth}}
{{/authMethods}}
// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
{{#produces}}
'{{{mediaType}}}'{{#hasMore}},{{/hasMore}}
{{/produces}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class Configuration {
return undefined;
}

let type = contentTypes.find(x => this.isJsonMime(x));
const type = contentTypes.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return contentTypes[0];
}
Expand All @@ -55,7 +55,7 @@ export class Configuration {
return undefined;
}

let type = accepts.find(x => this.isJsonMime(x));
const type = accepts.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return accepts[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -272,7 +272,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -323,7 +323,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -377,7 +377,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -423,7 +423,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -471,7 +471,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -526,7 +526,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -598,7 +598,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/json'
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -175,7 +175,7 @@ export class StoreService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/json'
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
Expand Down Expand Up @@ -214,7 +214,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -254,7 +254,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -245,7 +245,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -288,7 +288,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -331,7 +331,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -369,7 +369,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -421,7 +421,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -458,7 +458,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -500,7 +500,7 @@ export class UserService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class Configuration {
return undefined;
}

let type = contentTypes.find(x => this.isJsonMime(x));
const type = contentTypes.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return contentTypes[0];
}
Expand All @@ -55,7 +55,7 @@ export class Configuration {
return undefined;
}

let type = accepts.find(x => this.isJsonMime(x));
const type = accepts.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return accepts[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -272,7 +272,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -323,7 +323,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -377,7 +377,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -423,7 +423,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -471,7 +471,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -526,7 +526,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -598,7 +598,7 @@ export class PetService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/json'
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
Expand Down Expand Up @@ -175,7 +175,7 @@ export class StoreService {
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/json'
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
Expand Down Expand Up @@ -214,7 +214,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down Expand Up @@ -254,7 +254,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// to determine the Accept header
let httpHeaderAccepts: string[] = [
const httpHeaderAccepts: string[] = [
'application/xml',
'application/json'
];
Expand Down
Loading