Typescript: Incorrect casing: property "URL.searchparams" should be "URL.searchParams"

Created on 2 Mar 2017  路  3Comments  路  Source: microsoft/TypeScript



In lib.dom.d.ts, the searchparams property of the URL interface should be cased as searchParams according to MDN.

TypeScript Version: 2.2.1

Code

// A *self-contained* demonstration of the problem follows...
let pageUrl = new URL(location.href);
let url = pageUrl.searchParams.get("url");

Expected behavior:

Should compile successfully.

Actual behavior:

tsc returns an error when compiling.

src/index.ts(9,19): error TS2339: Property 'searchParams' does not exist on type 'URL'.
Bug lib.d.ts Fixed

Most helpful comment

All 3 comments

i installed [email protected] via npm but it doesn't seem to have the change in it yet

it has today's date on it but not a change from 21 days ago

i hope this can be fixed soon

the fixes has not been ported to the main TS repo, pushed a PR to port them in #14805.

Was this page helpful?
0 / 5 - 0 ratings