Skip to content

Commit 756fab4

Browse files
committed
refactor: add request.serialize method
1 parent 9d7b6e4 commit 756fab4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/request.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,9 @@ export class Request extends Macroable {
954954
}
955955

956956
/**
957-
* toJSON copy of the request
957+
* Serializes request to JSON format
958958
*/
959-
toJSON() {
959+
serialize() {
960960
return {
961961
id: this.id(),
962962
url: this.url(),
@@ -972,4 +972,11 @@ export class Request extends Macroable {
972972
subdomains: this.ctx?.subdomains || {},
973973
}
974974
}
975+
976+
/**
977+
* toJSON copy of the request
978+
*/
979+
toJSON() {
980+
return this.serialize()
981+
}
975982
}

0 commit comments

Comments
 (0)