All files / src/SERP/google index.ts

100% Statements 16/16
100% Branches 2/2
100% Functions 4/4
100% Lines 15/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251x     1x 1x 1x 1x 2x 2x 2x 2x 2x   1x 1x     1x 2x         1x  
import { Organic } from "./organic";
import { DFSEO } from "../..";
import { ISERP_Google_Languages_Response, ISERP_Google_Locations_Response } from "../../typings";
import { Images } from "./images";
import { Maps } from "./maps";
import { News } from "./news";
export class Google {
	public organic: Organic = new Organic(this.DFSEO);
	public images: Images = new Images(this.DFSEO);
	public maps: Maps = new Maps(this.DFSEO);
	public news: News = new News(this.DFSEO);
	constructor(private DFSEO: DFSEO) {}
 
	public languages(): Promise<ISERP_Google_Languages_Response> {
		return this.DFSEO.fetch({ method: "GET", url: "serp/google/languages" });
	}
 
	public locations(country?: string): Promise<ISERP_Google_Locations_Response> {
		return this.DFSEO.fetch({
			method: "GET",
			url: `serp/google/locations${country ? `/${country}` : ""}`,
		});
	}
}