@@ -28,9 +28,6 @@ class Http {
28
28
* @return {* } The response data on success.
29
29
*/
30
30
async get ( endpoint , sort = new SortOptions ( ) ) {
31
- if ( typeof endpoint !== "string" ) throw APIError . internal ( "The 'endpoint' parameter was not a string." ) ;
32
- if ( ! ( sort instanceof SortOptions ) ) throw APIError . internal ( "The 'sort' parameter was not of type SortOptions." ) ;
33
-
34
31
if ( sort . isSet ( ) ) endpoint += sort . toQueryString ( ) ;
35
32
await this . #throttler. stallIfRequired ( false ) ;
36
33
@@ -52,8 +49,6 @@ class Http {
52
49
* @return {number } The response data on success (ie. a content identifier).
53
50
*/
54
51
async post ( endpoint , body ) {
55
- if ( typeof endpoint !== "string" ) throw APIError . internal ( "The 'endpoint' parameter was not a string." ) ;
56
-
57
52
await this . #throttler. stallIfRequired ( true ) ;
58
53
59
54
try {
@@ -72,8 +67,6 @@ class Http {
72
67
* @param {object } body The request body options.
73
68
*/
74
69
async patch ( endpoint , body ) {
75
- if ( typeof endpoint !== "string" ) throw APIError . internal ( "The 'endpoint' parameter was not a string." ) ;
76
-
77
70
await this . #throttler. stallIfRequired ( true ) ;
78
71
79
72
try {
@@ -91,8 +84,6 @@ class Http {
91
84
* @param {string } endpoint The path of the endpoint (incl. any path parameters).
92
85
*/
93
86
async delete ( endpoint ) {
94
- if ( typeof endpoint !== "string" ) throw APIError . internal ( "The 'endpoint' parameter was not a string." ) ;
95
-
96
87
await this . #throttler. stallIfRequired ( true ) ;
97
88
98
89
try {
@@ -126,9 +117,6 @@ class Http {
126
117
* @return {Array<object> } An array of raw objects.
127
118
*/
128
119
async listUntil ( endpoint , shouldContinue , sort = new SortOptions ( ) ) {
129
- if ( typeof endpoint !== "string" ) throw APIError . internal ( "The 'endpoint' parameter was not a string." ) ;
130
- if ( ! ( sort instanceof SortOptions ) ) throw APIError . internal ( "The 'sort' parameter was not of type SortOptions." ) ;
131
-
132
120
sort . page = 1 ;
133
121
134
122
let allData = [ ] ;
0 commit comments