Skip to content

Code style fixes and type fixes #4

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
118 changes: 59 additions & 59 deletions GeolocationParams.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
export class GeolocationParams {

ipAddress: string;
fields: string;
excludes: string;
lang: string;
ipAddresses: string[];
constructor() {
this.ipAddress = "";
this.fields = "";
this.excludes = "";
this.lang = "en";
this.ipAddresses = [];
}

setIPAddress(ipAddress: string = ""): void {
this.ipAddress = ipAddress;
}

getIPAddress(): string {
return this.ipAddress;
}

setFields(fields: string = ""): void {
this.fields = fields;
}

getFields(): string {
return this.fields;
}

setExcludes(excludes: string = ""): void {
this.excludes = excludes;
}

getExcludes(): string {
return this.excludes;
}

setLang(lang: string = "en"): void {
this.lang = lang;
}

getLang(): string {
return this.lang;
}

setIPAddresses(ipAddresses : string[] = []): void {
if(ipAddresses.length > 50) {
console.log("Max. number of IP addresses cannot be more than 50.");
} else {
this.ipAddresses = ipAddresses;
}
}

getIPAddresses(): string[] {
return this.ipAddresses;
}
export class GeolocationParams {
public ipAddress: string;
public fields: string;
public excludes: string;
public lang: string;
public ipAddresses: string[];

constructor() {
this.ipAddress = "";
this.fields = "";
this.excludes = "";
this.lang = "en";
this.ipAddresses = [];
}

public setIPAddress(ipAddress: string = ""): void {
this.ipAddress = ipAddress;
}

public getIPAddress(): string {
return this.ipAddress;
}

public setFields(fields: string = ""): void {
this.fields = fields;
}

public getFields(): string {
return this.fields;
}

public setExcludes(excludes: string = ""): void {
this.excludes = excludes;
}

public getExcludes(): string {
return this.excludes;
}

public setLang(lang: string = "en"): void {
this.lang = lang;
}

public getLang(): string {
return this.lang;
}

public setIPAddresses(ipAddresses: string[] = []): void {
if (ipAddresses.length > 50) {
// tslint:disable-next-line:no-console
console.log("Max. number of IP addresses cannot be more than 50.");
} else {
this.ipAddresses = ipAddresses;
}
}

public getIPAddresses(): string[] {
return this.ipAddresses;
}
}
Loading