Eliminate usage of String.prototype.replaceAll to avoid incompatibility with old browsers (#1015)
This commit is contained in:
@@ -22,7 +22,7 @@ import { ErrorResponseHandler } from "../types";
|
||||
|
||||
export class API {
|
||||
invoke(method: string, url: string, data?: object) {
|
||||
const targetURL = `${baseUrl}${url}`.replaceAll("//", "/");
|
||||
const targetURL = `${baseUrl}${url}`.replace(/\/\//g, "/");
|
||||
return request(method, targetURL)
|
||||
.send(data)
|
||||
.then((res) => res.body)
|
||||
|
||||
Reference in New Issue
Block a user