Update url and switch form-urlencoded to export= (#35498)

* Update url and switch form-urlencoded to export=

Only the newer version uses export default. The version that DT has
types for still uses export=.

* Fix spacing in test
This commit is contained in:
Nathan Shively-Sanders 2019-05-15 12:37:05 -07:00 committed by GitHub
parent 1d2186a021
commit bd511dccbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,5 @@
// Type definitions for allure-js-commons 0.0
// Project: https://github.com/allure-framework/allure-js-commons
// Project: https://github.com/allure-framework/allure-js
// Definitions by: Denis Artyuhovich <https://github.com/zaqqaz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7

View File

@ -1,6 +1,6 @@
import encode, { FormEncodedOptions } from "form-urlencoded";
import encode = require("form-urlencoded");
const opts: FormEncodedOptions = {
const opts: encode.FormEncodedOptions = {
sorted: true,
skipIndex: false,
ignorenull: true

View File

@ -3,10 +3,13 @@
// Definitions by: Antoine Lépée <https://github.com/alepee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface FormEncodedOptions {
sorted?: boolean;
skipIndex?: boolean;
ignorenull?: boolean;
declare namespace formUrlEncoded {
interface FormEncodedOptions {
sorted?: boolean;
skipIndex?: boolean;
ignorenull?: boolean;
}
}
export default function(data: any, opts?: FormEncodedOptions): string;
declare function formUrlEncoded(data: any, opts?: formUrlEncoded.FormEncodedOptions): string;
export = formUrlEncoded;