You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Enable better tree shaking (#3356)
This commit is contained in:
committed by
GitHub
parent
e6a3b0ebc0
commit
6ef9f6c55e
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
* This is an internal module. See {@link MatrixHttpApi} for the public class.
|
||||
*/
|
||||
|
||||
import * as utils from "../utils";
|
||||
import { checkObjectHasKeys, encodeParams } from "../utils";
|
||||
import { TypedEventEmitter } from "../models/typed-event-emitter";
|
||||
import { Method } from "./method";
|
||||
import { ConnectionError, MatrixError } from "./errors";
|
||||
@@ -45,7 +45,7 @@ export class FetchHttpApi<O extends IHttpOpts> {
|
||||
private eventEmitter: TypedEventEmitter<HttpApiEvent, HttpApiEventHandlerMap>,
|
||||
public readonly opts: O,
|
||||
) {
|
||||
utils.checkObjectHasKeys(opts, ["baseUrl", "prefix"]);
|
||||
checkObjectHasKeys(opts, ["baseUrl", "prefix"]);
|
||||
opts.onlyData = !!opts.onlyData;
|
||||
opts.useAuthorizationHeader = opts.useAuthorizationHeader ?? true;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ export class FetchHttpApi<O extends IHttpOpts> {
|
||||
public getUrl(path: string, queryParams?: QueryDict, prefix?: string, baseUrl?: string): URL {
|
||||
const url = new URL((baseUrl ?? this.opts.baseUrl) + (prefix ?? this.opts.prefix) + path);
|
||||
if (queryParams) {
|
||||
utils.encodeParams(queryParams, url.searchParams);
|
||||
encodeParams(queryParams, url.searchParams);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user