Skip to content

Commit

Permalink
feat(ci): run format locally
Browse files Browse the repository at this point in the history
  • Loading branch information
ab7z committed Aug 13, 2024
1 parent 249bbf0 commit 2fc7ff1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/format-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ jobs:
with:
node-version: '20'
- run: npm ci
- run: npm run format:check
- name: Prettier check
run: npm run format:check
- name: Lint the code
run: npm run lint
10 changes: 5 additions & 5 deletions src/domrobot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class ApiClient {
methodParams: any = {},
clientTransactionId: string = ApiClient.generateClientTransactionId(),
language: string = this.language,
cacheOption?: "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached" | "default",
nextjsOptions?: object
cacheOption?: 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached' | 'default',
nextjsOptions?: object,
): Promise<any> {
if ('clTRID'! in methodParams && clientTransactionId !== null) {
methodParams.clTRID = clientTransactionId;
Expand All @@ -66,11 +66,11 @@ export class ApiClient {
'User-Agent': `DomRobot/${ApiClient.CLIENT_VERSION} (Node ${process.version})`,
}),
body: requestBody,
cache: cacheOption ?? "default",
cache: cacheOption ?? 'default',
};

if (nextjsOptions !== undefined) {
fetchOption = {...fetchOption, ...nextjsOptions};
fetchOption = { ...fetchOption, ...nextjsOptions };
}

const response = await fetch(this.apiUrl, fetchOption);
Expand All @@ -79,7 +79,7 @@ export class ApiClient {
this.cookie = response.headers.get('set-cookie');
}

const data = await response.json()
const data = await response.json();
if (this.debugMode) {
console.info(`Request (${apiMethod}): ${requestBody}`);
console.info(`Response (${apiMethod}): ${JSON.stringify(data)}`);
Expand Down

0 comments on commit 2fc7ff1

Please sign in to comment.