clean-quotes 1.0.1 → 1.0.3
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/.github/workflows/npmpublish.yml +4 -4
- package/README.md +1 -1
- package/index.js +3 -3
- package/package.json +1 -1
|
@@ -17,8 +17,8 @@ jobs:
|
|
|
17
17
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
|
18
18
|
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
21
|
-
- uses: actions/setup-node@
|
|
20
|
+
- uses: actions/checkout@v6
|
|
21
|
+
- uses: actions/setup-node@v6
|
|
22
22
|
with:
|
|
23
23
|
node-version: lts/krypton
|
|
24
24
|
|
|
@@ -38,8 +38,8 @@ jobs:
|
|
|
38
38
|
id-token: write # 👈 REQUIRED for Trusted Publishing
|
|
39
39
|
|
|
40
40
|
steps:
|
|
41
|
-
- uses: actions/checkout@
|
|
42
|
-
- uses: actions/setup-node@
|
|
41
|
+
- uses: actions/checkout@v6
|
|
42
|
+
- uses: actions/setup-node@v6
|
|
43
43
|
with:
|
|
44
44
|
node-version: lts/krypton
|
|
45
45
|
registry-url: https://registry.npmjs.org/
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<img src="https://img.shields.io/badge/License-MIT-yellow.svg">
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
-
* ✍️
|
|
8
|
+
* ✍️ Clean and standardize punctuation in strings — normalize `quotes`, `single quotes`, `dashes`, and `ellipsis` for `multi-language` text, `emojis` and consistent formatting.
|
|
9
9
|
* ♻️ Works seamlessly with `CommonJS`, `ESM` and `TypeScript`
|
|
10
10
|
|
|
11
11
|
# 📦 Install via [NPM](https://www.npmjs.com/package/clean-quotes)
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* clean-quotes - ✍️ Normalize quotes, dashes, and ellipsis in strings.
|
|
3
|
-
* @version: v1.0.
|
|
3
|
+
* @version: v1.0.3
|
|
4
4
|
* @link: https://github.com/tutyamxx/clean-quotes
|
|
5
5
|
* @license: MIT
|
|
6
6
|
**/
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
const cleanQuotes = (str) => (str ?? '')
|
|
24
24
|
?.replace(/[\u201C\u201D\u00AB\u00BB\u201E\u201F\u2033\u301D\u301E\u301F]/g, '"') // --| Normalize double quotes
|
|
25
25
|
?.replace(/[\u2018\u2019\u201A\u201B\u2032\u2035\u02BC\u02BB\u02BD\uFF07]/g, "'") // --| Normalize single quotes/apostrophes
|
|
26
|
-
?.replace(/[\u2026\u22EF\u22F1\uFE45]/g, '...') // --| Normalize
|
|
27
|
-
?.replace(/[\u2013\u2014\u2212\u2015]/g, '-') // --| Normalize
|
|
26
|
+
?.replace(/[\u2026\u22EF\u22F1\uFE45]/g, '...') // --| Normalize ellipsis
|
|
27
|
+
?.replace(/[\u2013\u2014\u2212\u2015]/g, '-') // --| Normalize dashes/hyphens
|
|
28
28
|
?.replace(/\s+/g, ' ') // --| Collapse multiple spaces into one and trim
|
|
29
29
|
?.trim();
|
|
30
30
|
|