Skip to content

Commit 557c23d

Browse files
authored
Merge pull request #3008 from hey-api/refactor/dsl-type-nodes-14
refactor: prefer single quote strings
2 parents 0b2314e + b784d58 commit 557c23d

File tree

849 files changed

+28346
-30975
lines changed

Some content is hidden

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

849 files changed

+28346
-30975
lines changed

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/sdk.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
2020

2121
export const postFoo = <ThrowOnError extends boolean = false>(options: Options<PostFooData, ThrowOnError>) => (options.client ?? client).post<PostFooResponses, unknown, ThrowOnError>({
2222
bodySerializer: null,
23-
url: "/foo",
23+
url: '/foo',
2424
...options,
2525
headers: {
26-
"Content-Type": "text/plain",
26+
'Content-Type': 'text/plain',
2727
...options.headers
2828
}
2929
});

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type PostFooData = {
88
body: string;
99
path?: never;
1010
query?: never;
11-
url: "/foo";
11+
url: '/foo';
1212
};
1313

1414
export type PostFooResponses = {

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-PascalCase/types.gen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ export type ClientOptions = {
44
baseUrl: string;
55
};
66

7-
export const _110 = { 110: "1-10", 1120: "11-20" } as const;
7+
export const _110 = { 110: '1-10', 1120: '11-20' } as const;
88

99
export type _110 = typeof _110[keyof typeof _110];
1010

11-
export const MyFoo = { MyFoo: "myFoo", MyBar: "myBar" } as const;
11+
export const MyFoo = { MyFoo: 'myFoo', MyBar: 'myBar' } as const;
1212

1313
export type MyFoo = typeof MyFoo[keyof typeof MyFoo];
1414

15-
export const MyFoo2 = { MyFoo: "MyFoo", MyBar: "MyBar" } as const;
15+
export const MyFoo2 = { MyFoo: 'MyFoo', MyBar: 'MyBar' } as const;
1616

1717
export type MyFoo2 = typeof MyFoo2[keyof typeof MyFoo2];
1818

1919
export const Foo = {
20-
Foo: "foo",
21-
Bar: "bar",
22-
"": "",
20+
Foo: 'foo',
21+
Bar: 'bar',
22+
'': '',
2323
True: true,
2424
False: false
2525
} as const;
@@ -30,17 +30,17 @@ export const Numbers = {
3030
100: 100,
3131
200: 200,
3232
300: 300,
33-
"-100": -100,
34-
"-200": -200,
35-
"-300": -300
33+
'-100': -100,
34+
'-200': -200,
35+
'-300': -300
3636
} as const;
3737

3838
export type Numbers = typeof Numbers[keyof typeof Numbers];
3939

4040
export const Arrays = {
41-
0: ["foo"],
42-
1: ["bar"],
43-
2: ["baz"]
41+
0: ['foo'],
42+
1: ['bar'],
43+
2: ['baz']
4444
} as const;
4545

4646
export type Arrays = typeof Arrays[keyof typeof Arrays];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-SCREAMING_SNAKE_CASE/types.gen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ export type ClientOptions = {
44
baseUrl: string;
55
};
66

7-
export const _110 = { "1_10": "1-10", "11_20": "11-20" } as const;
7+
export const _110 = { '1_10': '1-10', '11_20': '11-20' } as const;
88

99
export type _110 = typeof _110[keyof typeof _110];
1010

11-
export const MyFoo = { MY_FOO: "myFoo", MY_BAR: "myBar" } as const;
11+
export const MyFoo = { MY_FOO: 'myFoo', MY_BAR: 'myBar' } as const;
1212

1313
export type MyFoo = typeof MyFoo[keyof typeof MyFoo];
1414

15-
export const MyFoo2 = { MY_FOO: "MyFoo", MY_BAR: "MyBar" } as const;
15+
export const MyFoo2 = { MY_FOO: 'MyFoo', MY_BAR: 'MyBar' } as const;
1616

1717
export type MyFoo2 = typeof MyFoo2[keyof typeof MyFoo2];
1818

1919
export const Foo = {
20-
FOO: "foo",
21-
BAR: "bar",
22-
"": "",
20+
FOO: 'foo',
21+
BAR: 'bar',
22+
'': '',
2323
TRUE: true,
2424
FALSE: false
2525
} as const;
@@ -30,17 +30,17 @@ export const Numbers = {
3030
100: 100,
3131
200: 200,
3232
300: 300,
33-
"-100": -100,
34-
"-200": -200,
35-
"-300": -300
33+
'-100': -100,
34+
'-200': -200,
35+
'-300': -300
3636
} as const;
3737

3838
export type Numbers = typeof Numbers[keyof typeof Numbers];
3939

4040
export const Arrays = {
41-
0: ["foo"],
42-
1: ["bar"],
43-
2: ["baz"]
41+
0: ['foo'],
42+
1: ['bar'],
43+
2: ['baz']
4444
} as const;
4545

4646
export type Arrays = typeof Arrays[keyof typeof Arrays];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-camelCase/types.gen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ export type ClientOptions = {
44
baseUrl: string;
55
};
66

7-
export const _110 = { 110: "1-10", 1120: "11-20" } as const;
7+
export const _110 = { 110: '1-10', 1120: '11-20' } as const;
88

99
export type _110 = typeof _110[keyof typeof _110];
1010

11-
export const MyFoo = { myFoo: "myFoo", myBar: "myBar" } as const;
11+
export const MyFoo = { myFoo: 'myFoo', myBar: 'myBar' } as const;
1212

1313
export type MyFoo = typeof MyFoo[keyof typeof MyFoo];
1414

15-
export const MyFoo2 = { myFoo: "MyFoo", myBar: "MyBar" } as const;
15+
export const MyFoo2 = { myFoo: 'MyFoo', myBar: 'MyBar' } as const;
1616

1717
export type MyFoo2 = typeof MyFoo2[keyof typeof MyFoo2];
1818

1919
export const Foo = {
20-
foo: "foo",
21-
bar: "bar",
22-
"": "",
20+
foo: 'foo',
21+
bar: 'bar',
22+
'': '',
2323
true: true,
2424
false: false
2525
} as const;
@@ -30,17 +30,17 @@ export const Numbers = {
3030
100: 100,
3131
200: 200,
3232
300: 300,
33-
"-100": -100,
34-
"-200": -200,
35-
"-300": -300
33+
'-100': -100,
34+
'-200': -200,
35+
'-300': -300
3636
} as const;
3737

3838
export type Numbers = typeof Numbers[keyof typeof Numbers];
3939

4040
export const Arrays = {
41-
0: ["foo"],
42-
1: ["bar"],
43-
2: ["baz"]
41+
0: ['foo'],
42+
1: ['bar'],
43+
2: ['baz']
4444
} as const;
4545

4646
export type Arrays = typeof Arrays[keyof typeof Arrays];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-preserve/types.gen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ export type ClientOptions = {
44
baseUrl: string;
55
};
66

7-
export const _110 = { "1-10": "1-10", "11-20": "11-20" } as const;
7+
export const _110 = { '1-10': '1-10', '11-20': '11-20' } as const;
88

99
export type _110 = typeof _110[keyof typeof _110];
1010

11-
export const MyFoo = { myFoo: "myFoo", myBar: "myBar" } as const;
11+
export const MyFoo = { myFoo: 'myFoo', myBar: 'myBar' } as const;
1212

1313
export type MyFoo = typeof MyFoo[keyof typeof MyFoo];
1414

15-
export const MyFoo2 = { MyFoo: "MyFoo", MyBar: "MyBar" } as const;
15+
export const MyFoo2 = { MyFoo: 'MyFoo', MyBar: 'MyBar' } as const;
1616

1717
export type MyFoo2 = typeof MyFoo2[keyof typeof MyFoo2];
1818

1919
export const Foo = {
20-
foo: "foo",
21-
bar: "bar",
22-
"": "",
20+
foo: 'foo',
21+
bar: 'bar',
22+
'': '',
2323
true: true,
2424
false: false
2525
} as const;
@@ -30,17 +30,17 @@ export const Numbers = {
3030
100: 100,
3131
200: 200,
3232
300: 300,
33-
"-100": -100,
34-
"-200": -200,
35-
"-300": -300
33+
'-100': -100,
34+
'-200': -200,
35+
'-300': -300
3636
} as const;
3737

3838
export type Numbers = typeof Numbers[keyof typeof Numbers];
3939

4040
export const Arrays = {
41-
0: ["foo"],
42-
1: ["bar"],
43-
2: ["baz"]
41+
0: ['foo'],
42+
1: ['bar'],
43+
2: ['baz']
4444
} as const;
4545

4646
export type Arrays = typeof Arrays[keyof typeof Arrays];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-javascript-snake_case/types.gen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ export type ClientOptions = {
44
baseUrl: string;
55
};
66

7-
export const _110 = { "1_10": "1-10", "11_20": "11-20" } as const;
7+
export const _110 = { '1_10': '1-10', '11_20': '11-20' } as const;
88

99
export type _110 = typeof _110[keyof typeof _110];
1010

11-
export const MyFoo = { my_foo: "myFoo", my_bar: "myBar" } as const;
11+
export const MyFoo = { my_foo: 'myFoo', my_bar: 'myBar' } as const;
1212

1313
export type MyFoo = typeof MyFoo[keyof typeof MyFoo];
1414

15-
export const MyFoo2 = { my_foo: "MyFoo", my_bar: "MyBar" } as const;
15+
export const MyFoo2 = { my_foo: 'MyFoo', my_bar: 'MyBar' } as const;
1616

1717
export type MyFoo2 = typeof MyFoo2[keyof typeof MyFoo2];
1818

1919
export const Foo = {
20-
foo: "foo",
21-
bar: "bar",
22-
"": "",
20+
foo: 'foo',
21+
bar: 'bar',
22+
'': '',
2323
true: true,
2424
false: false
2525
} as const;
@@ -30,17 +30,17 @@ export const Numbers = {
3030
100: 100,
3131
200: 200,
3232
300: 300,
33-
"-100": -100,
34-
"-200": -200,
35-
"-300": -300
33+
'-100': -100,
34+
'-200': -200,
35+
'-300': -300
3636
} as const;
3737

3838
export type Numbers = typeof Numbers[keyof typeof Numbers];
3939

4040
export const Arrays = {
41-
0: ["foo"],
42-
1: ["bar"],
43-
2: ["baz"]
41+
0: ['foo'],
42+
1: ['bar'],
43+
2: ['baz']
4444
} as const;
4545

4646
export type Arrays = typeof Arrays[keyof typeof Arrays];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-PascalCase/types.gen.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ export type ClientOptions = {
55
};
66

77
export enum _110 {
8-
_110 = "1-10",
9-
_1120 = "11-20"
8+
_110 = '1-10',
9+
_1120 = '11-20'
1010
}
1111

1212
export enum MyFoo {
13-
MyFoo = "myFoo",
14-
MyBar = "myBar"
13+
MyFoo = 'myFoo',
14+
MyBar = 'myBar'
1515
}
1616

1717
export enum MyFoo2 {
18-
MyFoo = "MyFoo",
19-
MyBar = "MyBar"
18+
MyFoo = 'MyFoo',
19+
MyBar = 'MyBar'
2020
}
2121

22-
export type Foo = "foo" | "bar" | "" | true | false;
22+
export type Foo = 'foo' | 'bar' | '' | true | false;
2323

2424
export enum Numbers {
2525
_100 = 100,
2626
_200 = 200,
2727
_300 = 300,
28-
"_-100" = -100,
29-
"_-200" = -200,
30-
"_-300" = -300
28+
'_-100' = -100,
29+
'_-200' = -200,
30+
'_-300' = -300
3131
}
3232

3333
export type Arrays = [
34-
"foo"
34+
'foo'
3535
] | [
36-
"bar"
36+
'bar'
3737
] | [
38-
"baz"
38+
'baz'
3939
];

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/enum-names-values-typescript-SCREAMING_SNAKE_CASE/types.gen.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ export type ClientOptions = {
55
};
66

77
export enum _110 {
8-
"1_10" = "1-10",
9-
"11_20" = "11-20"
8+
'1_10' = '1-10',
9+
'11_20' = '11-20'
1010
}
1111

1212
export enum MyFoo {
13-
MY_FOO = "myFoo",
14-
MY_BAR = "myBar"
13+
MY_FOO = 'myFoo',
14+
MY_BAR = 'myBar'
1515
}
1616

1717
export enum MyFoo2 {
18-
MY_FOO = "MyFoo",
19-
MY_BAR = "MyBar"
18+
MY_FOO = 'MyFoo',
19+
MY_BAR = 'MyBar'
2020
}
2121

22-
export type Foo = "foo" | "bar" | "" | true | false;
22+
export type Foo = 'foo' | 'bar' | '' | true | false;
2323

2424
export enum Numbers {
2525
_100 = 100,
2626
_200 = 200,
2727
_300 = 300,
28-
"_-100" = -100,
29-
"_-200" = -200,
30-
"_-300" = -300
28+
'_-100' = -100,
29+
'_-200' = -200,
30+
'_-300' = -300
3131
}
3232

3333
export type Arrays = [
34-
"foo"
34+
'foo'
3535
] | [
36-
"bar"
36+
'bar'
3737
] | [
38-
"baz"
38+
'baz'
3939
];

0 commit comments

Comments
 (0)