mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Correct return type of Node querystring.parse (#20651)
* Correct return type of Node querystring.parse https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options * request-promise-native: require TS 2.2 to fix error from Node typings * Node querystring.parse: return type: query value as array of strings * Fix tests for request, request-promise, request-promise-native
This commit is contained in:
Vendored
+1
-1
@@ -797,7 +797,7 @@ declare module "querystring" {
|
||||
}
|
||||
|
||||
export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
|
||||
export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any;
|
||||
export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): { [key: string]: string | string[] };
|
||||
export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T;
|
||||
export function escape(str: string): string;
|
||||
export function unescape(str: string): string;
|
||||
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/request/request-promise-native
|
||||
// Definitions by: Gustavo Henke <https://github.com/gustavohenke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import request = require('request');
|
||||
import http = require('http');
|
||||
|
||||
@@ -282,7 +282,7 @@ rpn.post({ url, oauth }, (e, r, body) => {
|
||||
consumer_key: CONSUMER_KEY,
|
||||
consumer_secret: CONSUMER_SECRET,
|
||||
token: auth_data.oauth_token,
|
||||
token_secret: req_data.oauth_token_secret,
|
||||
token_secret: req_data.oauth_token_secret as string,
|
||||
verifier: auth_data.oauth_verifier,
|
||||
};
|
||||
url = 'https://api.twitter.com/oauth/access_token';
|
||||
|
||||
@@ -304,7 +304,7 @@ request.post({ url, oauth }, (e, r, body) => {
|
||||
consumer_key: CONSUMER_KEY,
|
||||
consumer_secret: CONSUMER_SECRET,
|
||||
token: auth_data.oauth_token,
|
||||
token_secret: req_data.oauth_token_secret,
|
||||
token_secret: req_data.oauth_token_secret as string,
|
||||
verifier: auth_data.oauth_verifier,
|
||||
};
|
||||
const url = 'https://api.twitter.com/oauth/access_token';
|
||||
|
||||
@@ -468,7 +468,7 @@ request.post({url:url, oauth:oauth}, function (e, r, body) {
|
||||
{ consumer_key: CONSUMER_KEY
|
||||
, consumer_secret: CONSUMER_SECRET
|
||||
, token: auth_data.oauth_token
|
||||
, token_secret: req_data.oauth_token_secret
|
||||
, token_secret: req_data.oauth_token_secret as string
|
||||
, verifier: auth_data.oauth_verifier
|
||||
}
|
||||
, url = 'https://api.twitter.com/oauth/access_token'
|
||||
|
||||
Reference in New Issue
Block a user