@senhainfo/shared-utils 1.5.22 → 1.6.0
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/lib/format-text.d.ts +3 -1
- package/lib/format-text.d.ts.map +1 -1
- package/lib/format-text.js +115 -7
- package/lib/format-text.js.map +1 -1
- package/package.json +2 -2
package/lib/format-text.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type CapitalizeModeType = 'words' | 'first-letter';
|
|
2
2
|
type NormalizeOptions = {
|
|
3
3
|
/**
|
|
4
|
-
* Removes diacritics from the text.
|
|
4
|
+
* Removes diacritics from the text (e.g. "João" -> "Joao").
|
|
5
5
|
* Set this to `false` to preserve diacritics.
|
|
6
6
|
* @default true
|
|
7
7
|
*/
|
|
@@ -20,6 +20,8 @@ type NormalizeOptions = {
|
|
|
20
20
|
trim?: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Set the length of the text to which it should be normalized.
|
|
23
|
+
* Counted in Unicode code points (not UTF-16 units), so astral
|
|
24
|
+
* characters (e.g. rare CJK ideographs) aren't cut in half.
|
|
23
25
|
*/
|
|
24
26
|
maxLength?: number;
|
|
25
27
|
};
|
package/lib/format-text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-text.d.ts","sourceRoot":"","sources":["../src/format-text.ts"],"names":[],"mappings":"AAEA,KAAK,kBAAkB,GAAG,OAAO,GAAG,cAAc,CAAC;AAEnD,KAAK,gBAAgB,GAAG;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf
|
|
1
|
+
{"version":3,"file":"format-text.d.ts","sourceRoot":"","sources":["../src/format-text.ts"],"names":[],"mappings":"AAEA,KAAK,kBAAkB,GAAG,OAAO,GAAG,cAAc,CAAC;AAEnD,KAAK,gBAAgB,GAAG;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsEF,qBAAa,UAAU;IACrB;;;;;;;OAOG;IACI,SAAS,CACd,IAAI,CAAC,EAAE,MAAM,EACb,EAAE,gBAAuB,EAAE,YAAmB,EAAE,IAAW,EAAE,SAAS,EAAE,GAAE,gBAAqB,GAC9F,MAAM;IAgET;;;;;;OAMG;IACI,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,kBAA4B,GAAG,MAAM;IAmH5E;;;;;OAKG;IACI,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAQnD;;;;;OAKG;IACI,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3C;;;;;OAKG;IACI,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;CAkD5C"}
|
package/lib/format-text.js
CHANGED
|
@@ -2,6 +2,61 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormatText = void 0;
|
|
4
4
|
const confusables_1 = require("confusables");
|
|
5
|
+
/**
|
|
6
|
+
* Checks if a single character is a "base Latin letter + diacritic",
|
|
7
|
+
* e.g. "é", "ã", "ç", "ü" — as opposed to a character from another
|
|
8
|
+
* script that merely *looks* like a Latin letter (the actual case
|
|
9
|
+
* `confusables` is meant to catch, e.g. Cyrillic "а" vs Latin "a").
|
|
10
|
+
*
|
|
11
|
+
* Works by decomposing (NFD): a legitimate accented Latin letter
|
|
12
|
+
* decomposes into more than one code point, where the first is a
|
|
13
|
+
* plain ASCII letter. This works for any language (pt, fr, de, etc.)
|
|
14
|
+
* without needing a hardcoded list of Unicode ranges.
|
|
15
|
+
*/
|
|
16
|
+
function isDiacriticLatinChar(char) {
|
|
17
|
+
const decomposed = char.normalize('NFD');
|
|
18
|
+
return decomposed.length > 1 && /^[A-Za-z]/.test(decomposed);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Matches a full emoji *sequence* as a single unit, not just one code
|
|
22
|
+
* point — this matters because most emojis are made of several code
|
|
23
|
+
* points glued together, e.g.:
|
|
24
|
+
* - keycaps: digit + optional variation selector + U+20E3 ("1️⃣")
|
|
25
|
+
* - ZWJ sequences: pictograph + U+200D + pictograph (...) ("👨👩👧👦")
|
|
26
|
+
* - flags: two regional-indicator letters ("🇧🇷")
|
|
27
|
+
* If we protected code point by code point, `confusables` would still
|
|
28
|
+
* see the leftover joiners/selectors around the (now placeholder)
|
|
29
|
+
* base characters and normalize the sequence anyway.
|
|
30
|
+
*/
|
|
31
|
+
const EMOJI_SEQUENCE_RE = /(\p{Extended_Pictographic}\uFE0F?(\u200D\p{Extended_Pictographic}\uFE0F?)*|[0-9#*]\uFE0F?\u20E3|\p{Regional_Indicator}{2})/gu;
|
|
32
|
+
/**
|
|
33
|
+
* Temporarily swaps out characters/sequences we want `confusables` to
|
|
34
|
+
* leave alone for placeholder tokens (Private Use Area code points,
|
|
35
|
+
* which never occur in real text and aren't in confusables.txt), runs
|
|
36
|
+
* `confusables`' anti-spoofing pass on what's left, then restores the
|
|
37
|
+
* originals. Real homoglyphs (Cyrillic lookalikes, etc.) still get
|
|
38
|
+
* normalized either way — only the explicitly protected content survives.
|
|
39
|
+
*/
|
|
40
|
+
function withProtectedConfusables(text, { protectDiacritics, protectEmojis }, run) {
|
|
41
|
+
const preserved = [];
|
|
42
|
+
const protect = (match) => {
|
|
43
|
+
preserved.push(match);
|
|
44
|
+
return `\uE000${preserved.length - 1}\uE001`;
|
|
45
|
+
};
|
|
46
|
+
let protectedText = text;
|
|
47
|
+
if (protectEmojis) {
|
|
48
|
+
// Sequences first, and as whole units, so a later char-by-char
|
|
49
|
+
// pass (diacritics) can't split one apart.
|
|
50
|
+
protectedText = protectedText.replace(EMOJI_SEQUENCE_RE, protect);
|
|
51
|
+
}
|
|
52
|
+
if (protectDiacritics) {
|
|
53
|
+
protectedText = Array.from(protectedText)
|
|
54
|
+
.map((char) => (isDiacriticLatinChar(char) ? protect(char) : char))
|
|
55
|
+
.join('');
|
|
56
|
+
}
|
|
57
|
+
const result = run(protectedText);
|
|
58
|
+
return result.replace(/\uE000(\d+)\uE001/g, (_, index) => preserved[Number(index)]);
|
|
59
|
+
}
|
|
5
60
|
class FormatText {
|
|
6
61
|
/**
|
|
7
62
|
* Normalize a string by replacing special characters with their standard equivalents
|
|
@@ -15,20 +70,57 @@ class FormatText {
|
|
|
15
70
|
if (!text) {
|
|
16
71
|
return '';
|
|
17
72
|
}
|
|
18
|
-
|
|
73
|
+
// Invisible/control characters: always stripped, regardless of options.
|
|
74
|
+
// These never have a legitimate reason to reach a database field.
|
|
75
|
+
text = text.replace(/[\u00A0\u202F\u200B-\u200F\u2028\u2029\u2066-\u2069]/g, '');
|
|
19
76
|
if (removeDiacritics) {
|
|
20
|
-
|
|
77
|
+
// NFD decomposes accented letters into base letter + combining mark,
|
|
78
|
+
// e.g. "é" -> "e" + U+0301. We only do this decomposition when we're
|
|
79
|
+
// actually going to strip the marks — no reason to alter the string's
|
|
80
|
+
// internal representation otherwise.
|
|
81
|
+
text = text.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); // Diacritics
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Always keep the string in composed form (NFC) when diacritics are
|
|
85
|
+
// preserved. Without this, two visually-identical strings coming from
|
|
86
|
+
// different sources (e.g. one NFC from a DB, one NFD from a browser)
|
|
87
|
+
// would fail a `===` comparison and have different `.length`.
|
|
88
|
+
text = text.normalize('NFC');
|
|
21
89
|
}
|
|
22
90
|
if (removeEmojis) {
|
|
23
|
-
|
|
91
|
+
// NOTE: intentionally NOT using \p{Emoji} here. That property also
|
|
92
|
+
// matches plain digits 0-9, '#', and '*', because they're part of
|
|
93
|
+
// "keycap" emoji sequences (1️⃣, #️⃣). Using \p{Emoji} alone strips
|
|
94
|
+
// digits from unrelated text. \p{Extended_Pictographic} covers the
|
|
95
|
+
// vast majority of real emojis (faces, objects, symbols, flags)
|
|
96
|
+
// without touching digits.
|
|
97
|
+
text = text.replace(/\p{Extended_Pictographic}/gu, ''); // Emojis
|
|
24
98
|
}
|
|
25
99
|
if (trim) {
|
|
26
100
|
text = text.trim(); // Trim
|
|
27
101
|
}
|
|
28
|
-
if (maxLength !== undefined
|
|
29
|
-
text
|
|
102
|
+
if (maxLength !== undefined) {
|
|
103
|
+
// Use Array.from (or [...text]) instead of .substring/.slice so we
|
|
104
|
+
// count Unicode code points, not UTF-16 code units. .substring() can
|
|
105
|
+
// split a surrogate pair in half (e.g. certain emoji or rare CJK
|
|
106
|
+
// characters), producing an invalid/corrupted trailing character.
|
|
107
|
+
const chars = Array.from(text);
|
|
108
|
+
if (chars.length > maxLength) {
|
|
109
|
+
text = chars.slice(0, maxLength).join('');
|
|
110
|
+
}
|
|
30
111
|
}
|
|
31
|
-
|
|
112
|
+
// `confusables` normalizes homoglyphs/lookalike characters for
|
|
113
|
+
// anti-spoofing purposes (e.g. Cyrillic "а" -> Latin "a"). Its
|
|
114
|
+
// confusables.txt dataset also treats accented Latin letters (é, ã,
|
|
115
|
+
// ç...) AND emoji sequences like keycaps (1️⃣) as "confusable" with
|
|
116
|
+
// their plain-character equivalent, so calling it unconditionally
|
|
117
|
+
// strips them even when removeDiacritics/removeEmojis are false.
|
|
118
|
+
// Shield whatever the caller asked to preserve before running it.
|
|
119
|
+
const protectDiacritics = !removeDiacritics;
|
|
120
|
+
const protectEmojis = !removeEmojis;
|
|
121
|
+
return protectDiacritics || protectEmojis
|
|
122
|
+
? withProtectedConfusables(text, { protectDiacritics, protectEmojis }, confusables_1.remove)
|
|
123
|
+
: (0, confusables_1.remove)(text);
|
|
32
124
|
}
|
|
33
125
|
/**
|
|
34
126
|
* Capitalize a string
|
|
@@ -52,10 +144,26 @@ class FormatText {
|
|
|
52
144
|
return word.toLowerCase();
|
|
53
145
|
}
|
|
54
146
|
}
|
|
55
|
-
//
|
|
147
|
+
// Custom validations
|
|
56
148
|
if (word.match(/^(?:pj|ga7|lg|mt|gp|gbl|wl|hkd|nm|amd|crm|gg|rca|tti|mg|sc|gl|jbf)$/i)) {
|
|
57
149
|
return word.toUpperCase();
|
|
58
150
|
}
|
|
151
|
+
// Matches fiscal words
|
|
152
|
+
if (word.match(/^(?:efd|ncm|cfop)$/i)) {
|
|
153
|
+
return word.toUpperCase();
|
|
154
|
+
}
|
|
155
|
+
if (word.match(/^(?:dfe)$/i)) {
|
|
156
|
+
return 'DFe';
|
|
157
|
+
}
|
|
158
|
+
if (word.match(/^(?:df-e)$/i)) {
|
|
159
|
+
return 'DF-e';
|
|
160
|
+
}
|
|
161
|
+
if (word.match(/^(?:nfe)$/i)) {
|
|
162
|
+
return 'NFe';
|
|
163
|
+
}
|
|
164
|
+
if (word.match(/^(?:nf-e)$/i)) {
|
|
165
|
+
return 'NF-e';
|
|
166
|
+
}
|
|
59
167
|
// Matches special cases
|
|
60
168
|
if (word.match(/^(?:cde)$/i)) {
|
|
61
169
|
return word.toUpperCase();
|
package/lib/format-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-text.js","sourceRoot":"","sources":["../src/format-text.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;
|
|
1
|
+
{"version":3,"file":"format-text.js","sourceRoot":"","sources":["../src/format-text.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAkC1D;;;;;;;;;;GAUG;AACH,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,CAAC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CAAC,6BAA6B;QAE9D,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEnB,sDAAsD;QACtD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mEAAmE,EAAE,EAAE,CAAC,CAAC;QAE7F,uCAAuC;QACvC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QAEvC,oDAAoD;QACpD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAElC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1RD,gCA0RC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@senhainfo/shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/senha-info/senha-shared-utils.git"
|
|
7
7
|
},
|
|
8
|
-
"author": "Bruno Gaspar <
|
|
8
|
+
"author": "Bruno Gaspar <dev.brunogaspar@gmail.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "./lib/index.js",
|
|
11
11
|
"types": "./lib/index.d.ts",
|