Skip to content

Commit f71aeef

Browse files
authored
Merge pull request github#988 from CommanderRoot/refactor/rm-deprecated-substr
refactor: replace deprecated String.prototype.substr()
2 parents 3886398 + 0a71301 commit f71aeef

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

lib/actions-util.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export async function isAnalyzingDefaultBranch(): Promise<boolean> {
858858
// Get the current ref and trim and refs/heads/ prefix
859859
let currentRef = await getRef();
860860
currentRef = currentRef.startsWith("refs/heads/")
861-
? currentRef.substr("refs/heads/".length)
861+
? currentRef.slice("refs/heads/".length)
862862
: currentRef;
863863

864864
const event = getWorkflowEvent();

src/config-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ async function addQueriesAndPacksFromWorkflow(
849849
// should instead be added in addition
850850
function shouldAddConfigFileQueries(queriesInput: string | undefined): boolean {
851851
if (queriesInput) {
852-
return queriesInput.trimStart().substr(0, 1) === "+";
852+
return queriesInput.trimStart().slice(0, 1) === "+";
853853
}
854854

855855
return true;

src/init-action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async function sendSuccessStatusReport(
9999
}
100100
if (queriesInput !== undefined) {
101101
queriesInput = queriesInput.startsWith("+")
102-
? queriesInput.substr(1)
102+
? queriesInput.slice(1)
103103
: queriesInput;
104104
queries.push(...queriesInput.split(","));
105105
}

0 commit comments

Comments
 (0)