mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-07-27 18:40:54 +02:00
Fix some small typo's
This commit is contained in:
@@ -29,7 +29,7 @@ module.exports = class WumpRequest {
|
|||||||
|
|
||||||
query ( a, b ) {
|
query ( a, b ) {
|
||||||
if ( typeof a === 'object' ) Object.keys( a ).forEach( ( v ) => this.url.searchParams.append( v, a[ v ] ) );
|
if ( typeof a === 'object' ) Object.keys( a ).forEach( ( v ) => this.url.searchParams.append( v, a[ v ] ) );
|
||||||
else this.url.searchParams.append( a, ab )
|
else this.url.searchParams.append( a, b );
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ module.exports = class WumpRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compress () {
|
compress () {
|
||||||
this.compressed = true
|
this.compressed = true;
|
||||||
if ( !this.rHeaders[ 'accept-encoding' ] ) this.rHeaders[ 'accept-encoding' ] = c.join( ', ' );
|
if ( !this.rHeaders[ 'accept-encoding' ] ) this.rHeaders[ 'accept-encoding' ] = c.join( ', ' );
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@@ -97,10 +97,10 @@ module.exports = class WumpRequest {
|
|||||||
wumpRes = new WumpResponse( res );
|
wumpRes = new WumpResponse( res );
|
||||||
|
|
||||||
stream.on( 'error', ( e ) => reject( e ) );
|
stream.on( 'error', ( e ) => reject( e ) );
|
||||||
stream.on( 'data', ( c ) => wumpRes._addChunk( c ) )
|
stream.on( 'data', ( c ) => wumpRes._addChunk( c ) );
|
||||||
stream.on( 'end', () => resolve( wumpRes ) );
|
stream.on( 'end', () => resolve( wumpRes ) );
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
if ( this.url.protocol === 'http:' ) req = http.request( options, resHandler );
|
if ( this.url.protocol === 'http:' ) req = http.request( options, resHandler );
|
||||||
else if (this.url.protocol === 'https:') req = https.request( options, resHandler );
|
else if (this.url.protocol === 'https:') req = https.request( options, resHandler );
|
||||||
@@ -119,4 +119,4 @@ module.exports = class WumpRequest {
|
|||||||
req.end();
|
req.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wumpfetch",
|
"name": "wumpfetch",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "🚀 A lightweight and fast Node.js HTTP Client",
|
"description": "🚀 A lightweight and fast Node.js HTTP Client",
|
||||||
"author": "Wessel \"wesselgame\" T <discord@go2it.eu>",
|
"author": "Wessel \"wesselgame\" T <discord@go2it.eu>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
Reference in New Issue
Block a user