Skip to content

Commit f64080d

Browse files
fix: typo in the httpie style option not being correctly applied (Kong#254)
Co-authored-by: Dimitri Mitropoulos <[email protected]>
1 parent 998e403 commit f64080d

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/targets/shell/httpie/client.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ runCustomFixtures({
2424
headers: true,
2525
indent: false,
2626
pretty: 'x',
27-
print: 'x',
27+
print: 'y',
2828
short: true,
29-
style: 'x',
29+
style: 'z',
3030
timeout: 1,
3131
verbose: true,
32-
verify: 'x',
32+
verify: 'v',
3333
},
3434
expected: 'short-flags.sh',
3535
},
@@ -42,11 +42,11 @@ runCustomFixtures({
4242
headers: true,
4343
indent: false,
4444
pretty: 'x',
45-
print: 'x',
46-
style: 'x',
45+
print: 'y',
46+
style: 'z',
4747
timeout: 1,
4848
verbose: true,
49-
verify: 'x',
49+
verify: 'v',
5050
},
5151
expected: 'long-flags.sh',
5252
},

src/targets/shell/httpie/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const httpie: Client<HttpieOptions> = {
8888
}
8989

9090
if (opts.style) {
91-
flags.push(`--style=${opts.pretty}`);
91+
flags.push(`--style=${opts.style}`);
9292
}
9393

9494
if (opts.timeout) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
http --headers --body --verbose --print=x --verify=x --cert=foo --pretty=x --style=x --timeout=1 GET http://mockbin.com/har
1+
http --headers --body --verbose --print=y --verify=v --cert=foo --pretty=x --style=z --timeout=1 GET http://mockbin.com/har
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
http -h -b -v -p=x --verify=x --cert=foo --pretty=x --style=x --timeout=1 GET http://mockbin.com/har
1+
http -h -b -v -p=y --verify=v --cert=foo --pretty=x --style=z --timeout=1 GET http://mockbin.com/har

src/targets/targets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ export const isClient = (client: Client): client is Client => {
176176
throw new Error('targets client must have an `info` object with property `link`');
177177
}
178178

179-
if (!Object.prototype.hasOwnProperty.call(client, 'convert') || typeof client.convert !== 'function') {
179+
if (
180+
!Object.prototype.hasOwnProperty.call(client, 'convert') ||
181+
typeof client.convert !== 'function'
182+
) {
180183
throw new Error(
181184
'targets client must have a `convert` property containing a conversion function',
182185
);

0 commit comments

Comments
 (0)