Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypsScript][Angular] Use valid JS RegEx #6584

Merged
merged 1 commit into from
Sep 28, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class {{classname}} {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class PetService {
}

/**
*
*
* Extends object by coping non-existing properties.
* @param objA object to be extended
* @param objB source object
Expand Down Expand Up @@ -75,7 +75,7 @@ export class PetService {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down Expand Up @@ -248,7 +248,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -307,7 +307,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete,
headers: headers,
Expand Down Expand Up @@ -361,7 +361,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -415,7 +415,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -462,7 +462,7 @@ export class PetService {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -512,7 +512,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -582,7 +582,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


if (name !== undefined) {
formParams.set('name', <any>name);
}
Expand Down Expand Up @@ -658,7 +658,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


if (additionalMetadata !== undefined) {
formParams.set('additionalMetadata', <any>additionalMetadata);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class StoreService {
}

/**
*
*
* Extends object by coping non-existing properties.
* @param objA object to be extended
* @param objB source object
Expand Down Expand Up @@ -74,7 +74,7 @@ export class StoreService {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down Expand Up @@ -169,7 +169,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete,
headers: headers,
Expand Down Expand Up @@ -209,7 +209,7 @@ export class StoreService {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -251,7 +251,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -292,7 +292,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class UserService {
}

/**
*
*
* Extends object by coping non-existing properties.
* @param objA object to be extended
* @param objB source object
Expand Down Expand Up @@ -74,7 +74,7 @@ export class UserService {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down Expand Up @@ -234,7 +234,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -278,7 +278,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -322,7 +322,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -367,7 +367,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete,
headers: headers,
Expand Down Expand Up @@ -409,7 +409,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -463,7 +463,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -499,7 +499,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -546,7 +546,7 @@ export class UserService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class PetService {
}

/**
*
*
* Extends object by coping non-existing properties.
* @param objA object to be extended
* @param objB source object
Expand Down Expand Up @@ -75,7 +75,7 @@ export class PetService {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down Expand Up @@ -248,7 +248,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -307,7 +307,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete,
headers: headers,
Expand Down Expand Up @@ -361,7 +361,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -415,7 +415,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -462,7 +462,7 @@ export class PetService {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -512,7 +512,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down Expand Up @@ -582,7 +582,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


if (name !== undefined) {
formParams.set('name', <any>name);
}
Expand Down Expand Up @@ -658,7 +658,7 @@ export class PetService {
headers.set('Authorization', 'Bearer ' + accessToken);
}


if (additionalMetadata !== undefined) {
formParams.set('additionalMetadata', <any>additionalMetadata);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class StoreService {
}

/**
*
*
* Extends object by coping non-existing properties.
* @param objA object to be extended
* @param objB source object
Expand Down Expand Up @@ -74,7 +74,7 @@ export class StoreService {
}

public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}

Expand Down Expand Up @@ -169,7 +169,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete,
headers: headers,
Expand Down Expand Up @@ -209,7 +209,7 @@ export class StoreService {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -251,7 +251,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get,
headers: headers,
Expand Down Expand Up @@ -292,7 +292,7 @@ export class StoreService {
headers.set('Accept', produces.filter(item => this.isJsonMime(item)).join(';'));
}


headers.set('Content-Type', 'application/json');

let requestOptions: RequestOptionsArgs = new RequestOptions({
Expand Down
Loading