• Robert Knight's avatar
    Omit query params with `undefined` values from API calls · 71e9385e
    Robert Knight authored
    The previous version stated that it aimed to match the behavior of the
    `query-string` package but it was actually tested against Node's
    `querystring` package, which has slightly different behavior for this
    edge case. It omits parameters with `undefined` values and renders empty
    parameters for `null` values.
    
    The notebook view was calling `api.search({ uri: undefined, ... })` and
    this translated to `/api/search?uri=&...` which caused an error.
    
    Omit parameters instead in this case.
    71e9385e
url.js 1.13 KB