deenD
Convex Community9mo ago
1 reply
deen

URLSearchParams size property is unsupported in Convex

const params1 = new URLSearchParams('foo=bar&baz=qux')
console.log(params1.size) // expected: 2, convex: undefined

const params2 = new URLSearchParams({ a: '1', b: '2', c: '3' })
console.log(params2.size) // expected: 3, convex: undefined


Very much not a big deal because there's many other ways to do this, but I was writing a little query builder and for some reason used it (shamefully) like this if (searchParams.size) ..., which had me tricked for a while.

Added in node v18.16.0: https://nodejs.org/api/url.html#urlsearchparamssize
https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/size
MDN Web Docs
The size read-only property of the URLSearchParams interface indicates the total number of search parameter entries.
URLSearchParams: size property - Web APIs | MDN
Was this page helpful?