Skip to content

Commit 27fd8f4

Browse files
authored
Replace String.trimRight with String.trimEnd (#1810)
1 parent 8a3d9ef commit 27fd8f4

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

.changeset/tidy-hoops-feel.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@changesets/apply-release-plan": patch
3+
"@changesets/changelog-github": patch
4+
---
5+
6+
Replace deprecated `String.prototype.trimRight` with [`String.prototype.trimEnd`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd)

packages/apply-release-plan/src/test-utils/get-changelog-entry-with-git-hash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { RelevantChangesets } from "../types";
88
async function getReleaseLine(changeset: NewChangeset, cwd: string) {
99
const [firstLine, ...futureLines] = changeset.summary
1010
.split("\n")
11-
.map((l) => l.trimRight());
11+
.map((l) => l.trimEnd());
1212

1313
const [commitThatAddsFile] = await getCommitsThatAddFiles(
1414
[`.changeset/${changeset.id}.md`],

packages/changelog-git/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getReleaseLine = async (
1111
) => {
1212
const [firstLine, ...futureLines] = changeset.summary
1313
.split("\n")
14-
.map((l) => l.trimRight());
14+
.map((l) => l.trimEnd());
1515

1616
let returnVal = `- ${
1717
changeset.commit ? `${changeset.commit.slice(0, 7)}: ` : ""

packages/changelog-github/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const changelogFunctions: ChangelogFunctions = {
7676

7777
const [firstLine, ...futureLines] = replacedChangelog
7878
.split("\n")
79-
.map((l) => l.trimRight());
79+
.map((l) => l.trimEnd());
8080

8181
const links = await (async () => {
8282
if (prFromSummary !== undefined) {

packages/get-github-info/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const { getInfo } = require("@changesets/get-github-info");
3232
const getReleaseLine = async (changeset, type) => {
3333
const [firstLine, ...futureLines] = changeset.summary
3434
.split("\n")
35-
.map((l) => l.trimRight());
35+
.map((l) => l.trimEnd());
3636
// getInfo exposes the GH username and PR number if you want them directly
3737
// but it also exposes a set of links for the commit, PR and GH username
3838
let { user, pull, links } = await getInfo({

0 commit comments

Comments
 (0)