@thi.ng/strings 3.7.24 → 3.7.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/package.json +2 -2
- package/slugify.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-03-
|
|
3
|
+
- **Last updated**: 2024-03-18T08:40:00Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [3.7.25](https://github.com/thi-ng/umbrella/tree/@thi.ng/strings@3.7.25) (2024-03-18)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- minor update slugify()/slugifyGH() regexps ([03b77d1](https://github.com/thi-ng/umbrella/commit/03b77d1))
|
|
17
|
+
|
|
12
18
|
### [3.7.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/strings@3.7.4) (2023-12-18)
|
|
13
19
|
|
|
14
20
|
#### 🩹 Bug fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/strings",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.25",
|
|
4
4
|
"description": "Various string formatting & utility functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -204,5 +204,5 @@
|
|
|
204
204
|
"thi.ng": {
|
|
205
205
|
"year": 2015
|
|
206
206
|
},
|
|
207
|
-
"gitHead": "
|
|
207
|
+
"gitHead": "4b3d4ab6ce373ca817ad780f679572169a9ed733\n"
|
|
208
208
|
}
|
package/slugify.js
CHANGED
|
@@ -2,11 +2,11 @@ const src = "\xE0\xE1\xE4\xE2\xE3\xE5\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF2\xF3\xF
|
|
|
2
2
|
const dest = "aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------";
|
|
3
3
|
const re = new RegExp(src.split("").join("|"), "g");
|
|
4
4
|
const slugify = (str) => {
|
|
5
|
-
return str.toLowerCase().replace(/\s+/g, "-").replace(re, (c) => dest[src.indexOf(c)]).replace(/&+/g, "-and-").replace(/[^\w
|
|
5
|
+
return str.toLowerCase().replace(/\s+/g, "-").replace(re, (c) => dest[src.indexOf(c)]).replace(/&+/g, "-and-").replace(/[^\w-]+/g, "").replace(/\p{Emoji_Presentation}/gu, "").replace(/-{2,}/g, "-").replace(/(^-+)|(-+$)/g, "");
|
|
6
6
|
};
|
|
7
7
|
const slugifyGH = (str) => {
|
|
8
8
|
return str.toLowerCase().replace(
|
|
9
|
-
/[!"#$%&'()
|
|
9
|
+
/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~\u0000-\u001f\u2000-\u206f\u2700-\u27bf\u2e00-\u2e7f]/g,
|
|
10
10
|
""
|
|
11
11
|
).replace(/\p{Emoji_Presentation}/gu, "").replace(/\s/g, "-");
|
|
12
12
|
};
|