File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,22 @@ export class FetchResponse {
3131
3232 get html ( ) {
3333 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
3535 }
3636
3737 return Promise . reject ( new Error ( `Expected an HTML response but got "${ this . contentType } " instead` ) )
3838 }
3939
4040 get json ( ) {
4141 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 ( ) )
4343 }
4444
4545 return Promise . reject ( new Error ( `Expected a JSON response but got "${ this . contentType } " instead` ) )
4646 }
4747
4848 get text ( ) {
49- return this . response . text ( )
49+ return this . responseText || ( this . responseText = this . response . text ( ) )
5050 }
5151
5252 get isTurboStream ( ) {
You can’t perform that action at this time.
0 commit comments