Skip to content

Commit be7454b

Browse files
committed
upd: prettier
1 parent 3edb58c commit be7454b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ const users = await mockmate({
6767
### Different sources
6868

6969
```ts
70-
const users = await mockmate({
71-
category: "users",
72-
source: "fakestoreapi", // source: "jsonplaceholder"
73-
quantity: 2,
74-
});
70+
const users = await mockmate({
71+
category: "users",
72+
source: "fakestoreapi", // source: "jsonplaceholder"
73+
quantity: 2,
74+
});
7575
```
7676

7777
### Generate Schema

src/core/fetcher.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { SourceFetchError } from "./errors.js";
33
import axios from "axios";
44
import { getBaseUrl } from "../utils/config.js";
55

6-
export async function fetchData(category: DataCategory, source: DataSource = "jsonplaceholder") {
6+
export async function fetchData(
7+
category: DataCategory,
8+
source: DataSource = "jsonplaceholder"
9+
) {
710
try {
811
const baseUrl = getBaseUrl(source);
912
const response = await axios.get(`${baseUrl}/${category}`);

src/utils/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { DataSource } from "../core/types";
22

33
export const SOURCE_URLS: Record<DataSource, string> = {
4-
jsonplaceholder: "https://jsonplaceholder.typicode.com",
5-
fakestoreapi: "https://fakestoreapi.com"
4+
jsonplaceholder: "https://jsonplaceholder.typicode.com",
5+
fakestoreapi: "https://fakestoreapi.com",
66
};
77

88
export const BASE_URL = SOURCE_URLS.jsonplaceholder;
99

1010
export function getBaseUrl(source: DataSource): string {
11-
return SOURCE_URLS[source];
11+
return SOURCE_URLS[source];
1212
}

0 commit comments

Comments
 (0)