8000 replace w/ .replaceAll() · tandyx/github-lang-css@a9f83c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit a9f83c2

Browse files
committed
replace w/ .replaceAll()
1 parent b965c9a commit a9f83c2

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ const digitToWord = [
4040
const langFromGithub = "...";
4141

4242
const cssClass = langFromGithub
43-
.replace("+", "p")
44-
.replace("#", "-Sharp")
43+
.replaceAll("+", "P")
44+
.replaceAll("#", "-Sharp")
4545
.replace(/\s/g, "-")
46-
.replace(".", "-")
46+
.replaceAll(".", "-")
4747
.replace(/["'()]/g, "")
4848
.replace(/^\d/, (match) => digitToWord[match]);
49-
5049
```

build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ async function main() {
2626
const langColors = Object.keys(langs).reduce((acc, val) => {
2727
acc[
2828
val
29-
.replace("+", "p")
30-
.replace("#", "-Sharp")
29+
.replaceAll("+", "P")
30+
.replaceAll("#", "-Sharp")
3131
.replace(/\s/g, "-")
32-
.replace(".", "-")
32+
.replaceAll(".", "-")
3333
.replace(/["'()]/g, "")
3434
.replace(/^\d/, (match) => digitToWord[match])
3535
] = langs[val].color;

package.json

Lines changed: 1 addition & 1 deletion
610F
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-lang-css",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "github language colors in css and json",
55
"main": "index.css",
66
"scripts": {

0 commit comments

Comments
 (0)
0