File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,22 @@ export class FetchResponse {
31
31
32
32
get html ( ) {
33
33
if ( this . contentType . match ( / ^ ( a p p l i c a t i o n | t e x t ) \/ ( h t m l | x h t m l \+ x m l ) $ / ) ) {
34
- return this . response . text ( )
34
+ return this . text
35
35
}
36
36
37
37
return Promise . reject ( new Error ( `Expected an HTML response but got "${ this . contentType } " instead` ) )
38
38
}
39
39
40
40
get json ( ) {
41
41
if ( this . contentType . match ( / ^ a p p l i c a t i o n \/ j s o n / ) ) {
42
- return this . response . json ( )
42
+ return this . responseJson || ( this . responseJson = this . response . json ( ) )
43
43
}
44
44
45
45
return Promise . reject ( new Error ( `Expected a JSON response but got "${ this . contentType } " instead` ) )
46
46
}
47
47
48
48
get text ( ) {
49
- return this . response . text ( )
49
+ return this . responseText || ( this . responseText = this . response . text ( ) )
50
50
}
51
51
52
52
get isTurboStream ( ) {
You can’t perform that action at this time.
0 commit comments