Skip to content

Commit a5c233e

Browse files
authored
style: code format (#128)
1 parent ffbdac7 commit a5c233e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+180
-185
lines changed

examples/apis/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const createClient = <RequestOption>(apiClient: ApiClient<RequestOption>,
9191
const _baseUrl = baseUrl.replace(/\/$/, "");
9292
return {
9393
getBooks: (option?: RequestOption): Promise<Response$getBooks$Status$200["application/json"]> => {
94-
const url = _baseUrl + `/get/books`;
94+
const url = `${_baseUrl}/get/books`;
9595
const headers = {
9696
Accept: "application/json",
9797
};
@@ -105,7 +105,7 @@ export const createClient = <RequestOption>(apiClient: ApiClient<RequestOption>,
105105
);
106106
},
107107
searchBooks: (params: Params$searchBooks, option?: RequestOption): Promise<Response$searchBooks$Status$200["application/json"]> => {
108-
const url = _baseUrl + `/search/books`;
108+
const url = `${_baseUrl}/search/books`;
109109
const headers = {
110110
Accept: "application/json",
111111
};

examples/apis/sample-axios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const apiClientImpl: ApiClient<RequestOption> = {
3333
options?: RequestOption,
3434
): Promise<any> => {
3535
const query = generateQueryString(queryParameters);
36-
const requestUrl = query ? url + "?" + encodeURI(query) : url;
36+
const requestUrl = query ? `${url}?${encodeURI(query)}` : url;
3737
const response = await axios.default.request({
3838
url: requestUrl,
3939
method: convertHttpMethodToAxiosMethod(httpMethod),

examples/apis/sample-debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const apiClientImpl: ApiClient<RequestOption> = {
1515
options?: RequestOption,
1616
): Promise<any> => {
1717
const query = generateQueryString(queryParameters);
18-
const requestUrl = query ? url + "?" + encodeURI(query) : url;
18+
const requestUrl = query ? `${url}?${encodeURI(query)}` : url;
1919
console.log({
2020
httpMethod,
2121
url,

examples/apis/sample-fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const apiClientImpl: ApiClient<RequestOption> = {
1717
options?: RequestOption,
1818
): Promise<any> => {
1919
const query = generateQueryString(queryParameters);
20-
const requestUrl = query ? url + "?" + encodeURI(query) : url;
20+
const requestUrl = query ? `${url}?${encodeURI(query)}` : url;
2121
const response = await fetch(requestUrl, {
2222
body: JSON.stringify(requestBody),
2323
headers,

examples/apis/sample-superagent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const apiClientImpl: ApiClient<RequestOption> = {
1919
options?: RequestOption,
2020
): Promise<any> => {
2121
const query = generateQueryString(queryParameters);
22-
const requestUrl = query ? url + "?" + encodeURI(query) : url;
22+
const requestUrl = query ? `${url}?${encodeURI(query)}` : url;
2323

2424
return new Promise((resolve, reject) => {
2525
const agent = Superagent;

examples/readme-sample/ast-code-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TsGenerator } from "@himenon/openapi-typescript-code-generator/dist/api";
22
import * as Types from "@himenon/openapi-typescript-code-generator/dist/types";
33

4-
interface Option {}
4+
type Option = {};
55

66
const factory = TsGenerator.Factory.create();
77

examples/readme-sample/text-base-code-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface Option {
55
}
66

77
const generator: Types.CodeGenerator.GenerateFunction<Option> = (payload: Types.CodeGenerator.Params[], option): string[] => {
8-
if (option && option.showLog) {
8+
if (option?.showLog) {
99
console.log("show log message");
1010
}
1111
return ["Hello world"];

examples/readme-sample/use-extract-schema-params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Types from "@himenon/openapi-typescript-code-generator/dist/types";
22

3-
interface Option {}
3+
type Option = {};
44

55
const generator: Types.CodeGenerator.GenerateFunction<Option> = (payload: Types.CodeGenerator.Params[]): string[] => {
66
return payload.map(params => {

jest.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
testEnvironment: "node",
99
extensionsToTreatAsEsm: [".ts", ".tsx"],
1010
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
11-
transformIgnorePatterns: [`/node_modules/(?!|dot-prop)`],
11+
transformIgnorePatterns: ["/node_modules/(?!|dot-prop)"],
1212
transform: {
1313
"^.+\\.(t|j)sx?$": "@swc/jest",
1414
},

jest.snapshot.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
testEnvironment: "node",
99
extensionsToTreatAsEsm: [".ts", ".tsx"],
1010
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
11-
transformIgnorePatterns: [`/node_modules/(?!|dot-prop)`],
11+
transformIgnorePatterns: ["/node_modules/(?!|dot-prop)"],
1212
transform: {
1313
"^.+\\.(t|j)sx?$": [
1414
"@swc/jest",

0 commit comments

Comments
 (0)