@@ -35,26 +35,26 @@ class Hastebin {
3535 }
3636 } ;
3737
38- return new Promise ( async ( resolve , reject ) => {
38+ return new Promise ( async ( resolve , reject ) => {
3939 await fetch ( request . url , request . options )
40- . then ( async res => {
41- if ( ! res . ok ) return reject ( new Error ( res . statusText ) ) ;
40+ . then ( async response => {
41+ if ( ! response . ok ) return reject ( new Error ( response . statusText ) ) ;
4242
43- const { key } = await res . json ( ) ;
43+ const { key } = await response . json ( ) ;
4444
45- const HastebinObj = {
45+ const HastebinObject = {
4646 link : link . host + '/' + key + link . extension ,
4747 host : link . host ,
4848 key,
4949 extension : link . extension ,
5050 content : data ,
51- ratelimit : res . headers . get ( 'x-ratelimit-limit' ) ,
52- ratelimit_remaining : res . headers . get ( 'x-ratelimit-remaining' ) ,
53- status_txt : res . statusText ,
54- status_code : res . status
51+ ratelimit : response . headers . get ( 'x-ratelimit-limit' ) ,
52+ ratelimit_remaining : response . headers . get ( 'x-ratelimit-remaining' ) ,
53+ status_txt : response . statusText ,
54+ status_code : response . status
5555 } ;
5656
57- return resolve ( HastebinObj ) ;
57+ return resolve ( HastebinObject ) ;
5858 } )
5959 . catch ( error => reject ( new Error ( error ) ) ) ;
6060 } ) ;
@@ -72,7 +72,7 @@ class Hastebin {
7272 const link = {
7373 extension : url . replace ( hastebinURLS . regex , '' ) . includes ( '.' ) ? `.${ url . replace ( hastebinURLS . regex , '' ) . split ( '.' ) . pop ( ) } ` : '' ,
7474 host : hastebinURLS . httpsWWW ,
75- key : url . replace ( hastebinURLS . regex , '' ) . includes ( '.' ) ? url . replace ( hastebinURLS . regex , '' ) . split ( '.' ) . shift ( ) : url . replace ( / h t t p s ? : \/ \/ / , '' ) . split ( '/' ) . pop ( )
75+ key : url . replace ( hastebinURLS . regex , '' ) . includes ( '.' ) ? url . replace ( hastebinURLS . regex , '' ) . split ( '/' ) . pop ( ) . split ( ' .') . shift ( ) : url . replace ( / h t t p s ? : \/ \/ / , '' ) . split ( '/' ) . pop ( )
7676 } ;
7777 const request = {
7878 url : hastebinURLS . documentsHttpsWWW + '/' + link . key + link . extension ,
@@ -84,26 +84,26 @@ class Hastebin {
8484 }
8585 } ;
8686
87- return new Promise ( async ( resolve , reject ) => {
87+ return new Promise ( async ( resolve , reject ) => {
8888 await fetch ( request . url , request . options )
89- . then ( async res => {
90- if ( ! res . ok ) return reject ( new Error ( res . statusText ) ) ;
89+ . then ( async response => {
90+ if ( ! response . ok ) return reject ( new Error ( response . statusText ) ) ;
9191
92- const { key, data } = await res . json ( ) ;
92+ const { key, data } = await response . json ( ) ;
9393
94- const HastebinObj = {
94+ const HastebinObject = {
9595 link : link . host + '/' + key + link . extension ,
9696 host : link . host ,
9797 key,
9898 extension : link . extension ,
9999 content : data ,
100- ratelimit : res . headers . get ( 'x-ratelimit-limit' ) ,
101- ratelimit_remaining : res . headers . get ( 'x-ratelimit-remaining' ) ,
102- status_txt : res . statusText ,
103- status_code : res . status
100+ ratelimit : response . headers . get ( 'x-ratelimit-limit' ) ,
101+ ratelimit_remaining : response . headers . get ( 'x-ratelimit-remaining' ) ,
102+ status_txt : response . statusText ,
103+ status_code : response . status
104104 } ;
105105
106- return resolve ( HastebinObj ) ;
106+ return resolve ( HastebinObject ) ;
107107 } )
108108 . catch ( error => reject ( new Error ( error ) ) ) ;
109109 } ) ;
0 commit comments