Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix compatibility issue with replaceAll for older Node.js versio… #2439

Closed
wants to merge 1 commit into from

Conversation

mdqst
Copy link

@mdqst mdqst commented Dec 13, 2024

Why is this change needed?

In the previous implementation, the replaceAll method was used, which was introduced in ECMAScript 2021. This causes compatibility issues in older versions of Node.js or other environments that do not support this method.

To ensure broader compatibility, I have replaced replaceAll(" ", "") with replace(/ /g, ""), which uses regular expressions and works in older environments.

This change should resolve any issues for users running on older versions of Node.js or environments that do not support replaceAll.

Merge Checklist


PR-Codex overview

This PR focuses on improving the way whitespace is removed from the line variable when checking for the undesired datasource entry. It changes the method used to replace spaces in the line.

Detailed summary

  • Replaced line.replaceAll(" ", "") with line.replace(/ /g, "") to remove spaces from the line variable.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Dec 13, 2024

⚠️ No Changeset found

Latest commit: 088ba53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 10:59am

@sds
Copy link
Member

sds commented Dec 18, 2024

Thanks for the PR. We support Node 20+, and don't plan to support older versions.

@sds sds closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants