Skip to content

Conversation

@jenweber
Copy link
Contributor

@jenweber jenweber commented Mar 3, 2023

Replace it with plain old regex replace.

replaceAll would be easier to read, but may not be available in people's projects or node environments.

Similarly I decided not to escape the _ or -, since it's all by itself, but I could add an escape if preferred.

This addresses a blocker for emberjs/rfcs#898

@locks
Copy link
Contributor

locks commented Mar 3, 2023

From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll#browser_compatibility it seems most platforms have it since 2020 (Samsung Internet since 2021), so I think it's safe to use it!

@jenweber jenweber merged commit 0569cd4 into master Mar 13, 2023
@jenweber jenweber deleted the jw-string-deprecation branch March 13, 2023 21:02
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.

4 participants