Skip to content

Commit

Permalink
Updated deprecated substr and relaced it with substring. (#58732)
Browse files Browse the repository at this point in the history
Co-authored-by: Adit Sheth <[email protected]>
  • Loading branch information
shethaadit and Adit Sheth authored Nov 1, 2024
1 parent 7f62ae6 commit 46ea84f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export module DotNet {
// However since we're the one calling the import keyword, they would be resolved relative to
// this framework bundle URL. Fix this by providing an absolute URL.
if (typeof url === "string" && url.startsWith("./")) {
url = new URL(url.substr(2), document.baseURI).toString();
url = new URL(url.substring(2), document.baseURI).toString();
}

return import(/* webpackIgnore: true */ url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe("hubConnection", () => {
// client side method names are case insensitive
let methodName = "message";
const idx = Math.floor(Math.random() * (methodName.length - 1));
methodName = methodName.substr(0, idx) + methodName[idx].toUpperCase() + methodName.substr(idx + 1);
methodName = methodName.substring(0, idx) + methodName[idx].toUpperCase() + methodName.substring(idx + 1);

const receivePromise = new PromiseSource<string>();
hubConnection.on(methodName, (msg) => {
Expand All @@ -328,7 +328,7 @@ describe("hubConnection", () => {
// client side method names are case insensitive
let methodName = "message";
const idx = Math.floor(Math.random() * (methodName.length - 1));
methodName = methodName.substr(0, idx) + methodName[idx].toUpperCase() + methodName.substr(idx + 1);
methodName = methodName.substring(0, idx) + methodName[idx].toUpperCase() + methodName.substring(idx + 1);

let closeCount = 0;
let invocationCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/SignalR/clients/ts/signalr/src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function formatArrayBuffer(data: ArrayBuffer): string {
});

// Trim of trailing space.
return str.substr(0, str.length - 1);
return str.substring(0, str.length - 1);
}

// Also in signalr-protocol-msgpack/Utils.ts
Expand Down

0 comments on commit 46ea84f

Please sign in to comment.