punctilio 1.0.4 → 1.1.1
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/README.md +25 -10
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -1
- package/dist/constants.js.map +1 -1
- package/dist/dashes.d.ts +7 -51
- package/dist/dashes.d.ts.map +1 -1
- package/dist/dashes.js +66 -104
- package/dist/dashes.js.map +1 -1
- package/dist/index.d.ts +13 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/quotes.d.ts +4 -31
- package/dist/quotes.d.ts.map +1 -1
- package/dist/quotes.js +4 -13
- package/dist/quotes.js.map +1 -1
- package/dist/symbols.d.ts +16 -158
- package/dist/symbols.d.ts.map +1 -1
- package/dist/symbols.js +55 -189
- package/dist/symbols.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -1
- package/dist/utils.js.map +1 -1
- package/package.json +4 -1
package/dist/symbols.js
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Symbol
|
|
3
|
-
*
|
|
4
|
-
* Handles ellipses, multiplication signs, mathematical symbols, and
|
|
5
|
-
* common character sequences that should use proper Unicode glyphs.
|
|
6
|
-
*
|
|
7
|
-
* @module symbols
|
|
8
|
-
*/
|
|
9
|
-
import { UNICODE_SYMBOLS, ESCAPED_DEFAULT_SEPARATOR, wordBoundaryEnd } from "./constants.js";
|
|
10
|
-
/**
|
|
11
|
-
* Escapes special regex characters in a string.
|
|
12
|
-
*/
|
|
13
|
-
function escapeRegex(str) {
|
|
14
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
15
|
-
}
|
|
16
|
-
const { ELLIPSIS, MULTIPLICATION, NOT_EQUAL, PLUS_MINUS, COPYRIGHT, REGISTERED, TRADEMARK, DEGREE, ARROW_RIGHT, ARROW_LEFT, ARROW_LEFT_RIGHT, APPROXIMATE, LESS_EQUAL, GREATER_EQUAL, PRIME, DOUBLE_PRIME, NBSP, SUPERSCRIPT_ST, SUPERSCRIPT_ND, SUPERSCRIPT_RD, SUPERSCRIPT_TH, DOUBLE_QUESTION, QUESTION_EXCLAMATION, EXCLAMATION_QUESTION } = UNICODE_SYMBOLS;
|
|
17
|
-
/**
|
|
18
|
-
* Converts three periods to a proper ellipsis character.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* ellipsis("Wait for it...")
|
|
23
|
-
* // → "Wait for it…"
|
|
24
|
-
* ```
|
|
2
|
+
* Symbol transformations: ellipses, multiplication, math symbols, arrows.
|
|
25
3
|
*/
|
|
4
|
+
import escapeStringRegexp from "escape-string-regexp";
|
|
5
|
+
import { UNICODE_SYMBOLS, ESCAPED_DEFAULT_SEPARATOR, LATIN_LETTERS, wordBoundaryEnd } from "./constants.js";
|
|
6
|
+
const { ELLIPSIS, MULTIPLICATION, NOT_EQUAL, PLUS_MINUS, COPYRIGHT, REGISTERED, TRADEMARK, DEGREE, ARROW_RIGHT, ARROW_LEFT, ARROW_LEFT_RIGHT, APPROXIMATE, LESS_EQUAL, GREATER_EQUAL, PRIME, DOUBLE_PRIME, NBSP, SUPERSCRIPT_ST, SUPERSCRIPT_ND, SUPERSCRIPT_RD, SUPERSCRIPT_TH, DOUBLE_QUESTION, QUESTION_EXCLAMATION, EXCLAMATION_QUESTION, LEFT_DOUBLE_QUOTE, } = UNICODE_SYMBOLS;
|
|
7
|
+
/** Convert "..." to "…". */
|
|
26
8
|
export function ellipsis(text, options = {}) {
|
|
27
9
|
const chr = options.separator
|
|
28
|
-
?
|
|
10
|
+
? escapeStringRegexp(options.separator)
|
|
29
11
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
30
12
|
// Capture groups preserve separators: .(sep1)?.(sep2)?.
|
|
31
13
|
const pattern = new RegExp(`\\.(${chr})?\\.(${chr})?\\.`, "g");
|
|
@@ -33,37 +15,43 @@ export function ellipsis(text, options = {}) {
|
|
|
33
15
|
// Preserve separators by appending them after the ellipsis
|
|
34
16
|
return ELLIPSIS + (sep1 || "") + (sep2 || "");
|
|
35
17
|
});
|
|
36
|
-
text = text.replace(new RegExp(`${ELLIPSIS}(
|
|
18
|
+
text = text.replace(new RegExp(`${ELLIPSIS}(?=[${LATIN_LETTERS}\\d])`, "gu"), `${ELLIPSIS} `);
|
|
37
19
|
return text;
|
|
38
20
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Converts ASCII multiplication patterns to proper multiplication sign (×).
|
|
41
|
-
*
|
|
42
|
-
* Handles:
|
|
43
|
-
* - Dimensions: "5x5" → "5×5"
|
|
44
|
-
* - Trailing multiplier: "5x" → "5×" (when followed by word boundary)
|
|
45
|
-
* - Asterisk multiplication: "5*3" → "5×3" (when between numbers)
|
|
46
|
-
*/
|
|
21
|
+
/** Convert "5x5" to "5×5". Skips hex (0x5F). */
|
|
47
22
|
export function multiplication(text, options = {}) {
|
|
48
23
|
const chr = options.separator
|
|
49
|
-
?
|
|
24
|
+
? escapeStringRegexp(options.separator)
|
|
50
25
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
51
26
|
// Dimensions with spaces: preserve spacing
|
|
52
|
-
const
|
|
27
|
+
const leftNumPattern = `(?<leftNum>\\d+${chr}?)`;
|
|
28
|
+
const rightNumPattern = `(?<rightNum>${chr}?\\d)`;
|
|
29
|
+
const loosePattern = new RegExp(`${leftNumPattern}\\s+[xX*]\\s+${rightNumPattern}`, "g");
|
|
53
30
|
text = text.replace(loosePattern, `$<leftNum> ${MULTIPLICATION} $<rightNum>`);
|
|
54
31
|
// Dimensions without spaces: keep tight
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
// Use callback to skip hexadecimal patterns like "0x5F"
|
|
33
|
+
const tightPattern = new RegExp(`${leftNumPattern}(?<op>[xX*])${rightNumPattern}`, "g");
|
|
34
|
+
text = text.replace(tightPattern, (match, leftNum, op, rightNum) => {
|
|
35
|
+
// Skip if this looks like a hexadecimal: single 0 followed by x/X
|
|
36
|
+
if (leftNum === "0" && (op === "x" || op === "X")) {
|
|
37
|
+
return match; // Don't convert hex literals
|
|
38
|
+
}
|
|
39
|
+
return `${leftNum}${MULTIPLICATION}${rightNum}`;
|
|
40
|
+
});
|
|
57
41
|
// Trailing multiplier: 5x (followed by word boundary - space, punctuation, etc.)
|
|
58
42
|
// Uses marker-aware boundary to avoid false matches like "5x\uE000tra"
|
|
59
43
|
const wbe = wordBoundaryEnd(chr);
|
|
60
|
-
const trailingPattern = new RegExp(
|
|
61
|
-
text = text.replace(trailingPattern,
|
|
44
|
+
const trailingPattern = new RegExp(`${leftNumPattern}(?<op>[xX*])${wbe}`, "g");
|
|
45
|
+
text = text.replace(trailingPattern, (match, num, op) => {
|
|
46
|
+
// Skip if this looks like start of hexadecimal
|
|
47
|
+
if (num === "0" && (op === "x" || op === "X")) {
|
|
48
|
+
return match;
|
|
49
|
+
}
|
|
50
|
+
return `${num}${MULTIPLICATION}`;
|
|
51
|
+
});
|
|
62
52
|
return text;
|
|
63
53
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Converts ASCII mathematical symbols to proper Unicode equivalents.
|
|
66
|
-
*/
|
|
54
|
+
/** Convert !=, <=, >=, +/-, ~= to Unicode equivalents. */
|
|
67
55
|
export function mathSymbols(text) {
|
|
68
56
|
return text
|
|
69
57
|
.replace(/!=/g, NOT_EQUAL)
|
|
@@ -74,73 +62,41 @@ export function mathSymbols(text) {
|
|
|
74
62
|
.replace(/~=/g, APPROXIMATE)
|
|
75
63
|
.replace(/=~/g, APPROXIMATE);
|
|
76
64
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Converts ASCII representations of copyright, registered, and trademark
|
|
79
|
-
* symbols to proper Unicode characters.
|
|
80
|
-
*/
|
|
65
|
+
/** Convert (c), (r), (tm) to ©, ®, ™. */
|
|
81
66
|
export function legalSymbols(text) {
|
|
82
67
|
return text
|
|
83
68
|
.replace(/\(c\)/gi, COPYRIGHT)
|
|
84
69
|
.replace(/\(r\)/gi, REGISTERED)
|
|
85
70
|
.replace(/\(tm\)/gi, TRADEMARK);
|
|
86
71
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Converts arrow character sequences to Unicode arrows.
|
|
89
|
-
*
|
|
90
|
-
* Handles:
|
|
91
|
-
* - "->" or "-->" → "→"
|
|
92
|
-
* - "<-" or "<--" → "←"
|
|
93
|
-
* - "<->" or "<-->" → "↔"
|
|
94
|
-
*
|
|
95
|
-
* Note: Only converts when surrounded by spaces or at word boundaries
|
|
96
|
-
* to avoid false matches in code or URLs.
|
|
97
|
-
*/
|
|
72
|
+
/** Convert -> and <-> to arrows. */
|
|
98
73
|
export function arrows(text, options = {}) {
|
|
99
74
|
const chr = options.separator
|
|
100
|
-
?
|
|
75
|
+
? escapeStringRegexp(options.separator)
|
|
101
76
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
102
|
-
// Bidirectional arrow
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
text = text.replace(new RegExp(`(?<=[\\s${chr}]|^)<-{1,2}(?=[\\s${chr}]|$)`, "g"), ARROW_LEFT);
|
|
77
|
+
// Bidirectional arrow: <-> or <-->
|
|
78
|
+
text = text.replace(new RegExp(`(?<=[\\s${chr}]|^)<-+${chr}?>(?=[\\s${chr}]|$)`, "g"), ARROW_LEFT_RIGHT);
|
|
79
|
+
// Right arrow: -> or -->
|
|
80
|
+
text = text.replace(new RegExp(`(?<=[\\s${chr}]|^)-+>(?=[\\s${chr}]|$)`, "g"), ARROW_RIGHT);
|
|
81
|
+
// Left arrow: <- or <--
|
|
82
|
+
text = text.replace(new RegExp(`(?<=[\\s${chr}]|^)<-+(?=[\\s${chr}]|$)`, "g"), ARROW_LEFT);
|
|
109
83
|
return text;
|
|
110
84
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Adds degree symbol in temperature contexts.
|
|
113
|
-
*
|
|
114
|
-
* Handles:
|
|
115
|
-
* - "20 C" or "20C" → "20 °C" (Celsius)
|
|
116
|
-
* - "68 F" or "68F" → "68 °F" (Fahrenheit)
|
|
117
|
-
*
|
|
118
|
-
* Only matches when followed by C or F (case insensitive) to avoid
|
|
119
|
-
* false positives.
|
|
120
|
-
*/
|
|
85
|
+
/** Convert "20 C" or "20 F" to "20 °C" or "20 °F". Only matches uppercase C/F. */
|
|
121
86
|
export function degrees(text, options = {}) {
|
|
122
87
|
const chr = options.separator
|
|
123
|
-
?
|
|
88
|
+
? escapeStringRegexp(options.separator)
|
|
124
89
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
125
|
-
// Temperature with optional space before C or F
|
|
90
|
+
// Temperature with optional space before C or F (uppercase only)
|
|
126
91
|
// Handles separator between digit and unit
|
|
127
92
|
// Uses marker-aware boundary to avoid false matches like "20C\uE000elsius"
|
|
128
93
|
const wbe = wordBoundaryEnd(chr);
|
|
129
|
-
return text.replace(new RegExp(`(?<num>\\d${chr}?) ?(?<unit>[CF])${wbe}`, "
|
|
94
|
+
return text.replace(new RegExp(`(?<num>\\d${chr}?) ?(?<unit>[CF])${wbe}`, "g"), (_, num, unit) => `${num} ${DEGREE}${unit}`);
|
|
130
95
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Converts straight quotes after numbers to prime marks.
|
|
133
|
-
*
|
|
134
|
-
* Prime marks are used for:
|
|
135
|
-
* - Feet and inches: 5'10" → 5′10″
|
|
136
|
-
* - Arcminutes and arcseconds: 45° 30' 15" → 45° 30′ 15″
|
|
137
|
-
*
|
|
138
|
-
* This should be called BEFORE smart quote transformations to prevent
|
|
139
|
-
* quotes in measurements from being curled.
|
|
140
|
-
*/
|
|
96
|
+
/** Convert 5'10" to 5′10″ (prime marks). Call before smart quotes. */
|
|
141
97
|
export function primeMarks(text, options = {}) {
|
|
142
98
|
const chr = options.separator
|
|
143
|
-
?
|
|
99
|
+
? escapeStringRegexp(options.separator)
|
|
144
100
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
145
101
|
// Single prime: Matches digit + optional separator + apostrophe
|
|
146
102
|
// Lookahead ensures it's followed by: another digit, double quote, end of string, or punctuation
|
|
@@ -156,14 +112,10 @@ export function primeMarks(text, options = {}) {
|
|
|
156
112
|
// Negative lookbehind: ensures no opening quote within 20 chars before the digit
|
|
157
113
|
// Negative lookahead: ensures not followed by word characters
|
|
158
114
|
// Matches: 12" wide ✓, but not: "Term 1" ✗
|
|
159
|
-
const standaloneInchesPattern = new RegExp(`(?<!["
|
|
115
|
+
const standaloneInchesPattern = new RegExp(`(?<!["${LEFT_DOUBLE_QUOTE}]${chr}?[^"${chr}]{0,20})(?<numWithSep>\\d${chr}?)"(?!${chr}?[${LATIN_LETTERS}\\d_])`, "g");
|
|
160
116
|
text = text.replace(standaloneInchesPattern, `$<numWithSep>${DOUBLE_PRIME}`);
|
|
161
117
|
return text;
|
|
162
118
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Map of ASCII fractions to Unicode fraction characters.
|
|
165
|
-
* Pre-computed to avoid repeated object allocation.
|
|
166
|
-
*/
|
|
167
119
|
const FRACTION_MAP = {
|
|
168
120
|
"1/4": UNICODE_SYMBOLS.FRACTION_1_4,
|
|
169
121
|
"1/2": UNICODE_SYMBOLS.FRACTION_1_2,
|
|
@@ -181,27 +133,10 @@ const FRACTION_MAP = {
|
|
|
181
133
|
"5/8": UNICODE_SYMBOLS.FRACTION_5_8,
|
|
182
134
|
"7/8": UNICODE_SYMBOLS.FRACTION_7_8,
|
|
183
135
|
};
|
|
184
|
-
/**
|
|
185
|
-
* Converts common fractions to Unicode fraction characters.
|
|
186
|
-
*
|
|
187
|
-
* Handles: 1/4, 1/2, 3/4, 1/3, 2/3, 1/5, 2/5, 3/5, 4/5,
|
|
188
|
-
* 1/6, 5/6, 1/8, 3/8, 5/8, 7/8
|
|
189
|
-
*
|
|
190
|
-
* Only converts when the fraction is surrounded by word boundaries
|
|
191
|
-
* to avoid breaking URLs, file paths, or dates.
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```ts
|
|
195
|
-
* fractions("Add 1/2 cup of flour")
|
|
196
|
-
* // → "Add ½ cup of flour"
|
|
197
|
-
*
|
|
198
|
-
* fractions("About 3/4 complete")
|
|
199
|
-
* // → "About ¾ complete"
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
136
|
+
/** Convert 1/2, 1/4, etc. to ½, ¼, etc. */
|
|
202
137
|
export function fractions(text, options = {}) {
|
|
203
138
|
const chr = options.separator
|
|
204
|
-
?
|
|
139
|
+
? escapeStringRegexp(options.separator)
|
|
205
140
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
206
141
|
for (const [ascii, unicode] of Object.entries(FRACTION_MAP)) {
|
|
207
142
|
// Negative lookbehind/lookahead: ensures fraction is not part of a larger number or path
|
|
@@ -215,38 +150,16 @@ export function fractions(text, options = {}) {
|
|
|
215
150
|
}
|
|
216
151
|
return text;
|
|
217
152
|
}
|
|
218
|
-
/**
|
|
219
|
-
* Map of ordinal suffixes to their Unicode superscript equivalents.
|
|
220
|
-
*/
|
|
221
153
|
const ORDINAL_MAP = {
|
|
222
154
|
st: SUPERSCRIPT_ST,
|
|
223
155
|
nd: SUPERSCRIPT_ND,
|
|
224
156
|
rd: SUPERSCRIPT_RD,
|
|
225
157
|
th: SUPERSCRIPT_TH,
|
|
226
158
|
};
|
|
227
|
-
/**
|
|
228
|
-
|
|
229
|
-
*
|
|
230
|
-
* Handles ordinal numbers like:
|
|
231
|
-
* - "1st" → "1ˢᵗ"
|
|
232
|
-
* - "2nd" → "2ⁿᵈ"
|
|
233
|
-
* - "3rd" → "3ʳᵈ"
|
|
234
|
-
* - "4th" → "4ᵗʰ"
|
|
235
|
-
*
|
|
236
|
-
* Works with any number ending in appropriate suffixes (21st, 42nd, 103rd, etc.)
|
|
237
|
-
*
|
|
238
|
-
* @example
|
|
239
|
-
* ```ts
|
|
240
|
-
* superscript("The 1st place winner")
|
|
241
|
-
* // → "The 1ˢᵗ place winner"
|
|
242
|
-
*
|
|
243
|
-
* superscript("Born on the 30th of June")
|
|
244
|
-
* // → "Born on the 30ᵗʰ of June"
|
|
245
|
-
* ```
|
|
246
|
-
*/
|
|
247
|
-
export function superscript(text, options = {}) {
|
|
159
|
+
/** Convert 1st, 2nd, 3rd, 4th to superscript ordinals. */
|
|
160
|
+
export function superscriptOrdinal(text, options = {}) {
|
|
248
161
|
const chr = options.separator
|
|
249
|
-
?
|
|
162
|
+
? escapeStringRegexp(options.separator)
|
|
250
163
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
251
164
|
// Match number + optional separator + ordinal suffix at word boundary
|
|
252
165
|
// Use case-insensitive matching for the suffix
|
|
@@ -258,43 +171,14 @@ export function superscript(text, options = {}) {
|
|
|
258
171
|
return num + superscriptSuffix;
|
|
259
172
|
});
|
|
260
173
|
}
|
|
261
|
-
/**
|
|
262
|
-
* Collapses multiple consecutive spaces (including non-breaking spaces) into a single space.
|
|
263
|
-
*
|
|
264
|
-
* When multiple spaces or non-breaking spaces appear in sequence, this function
|
|
265
|
-
* keeps only the first space character, preserving its type.
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```ts
|
|
269
|
-
* collapseSpaces("hello world")
|
|
270
|
-
* // → "hello world"
|
|
271
|
-
*
|
|
272
|
-
* collapseSpaces("foo\u00A0\u00A0bar") // two nbsp
|
|
273
|
-
* // → "foo\u00A0bar" // single nbsp
|
|
274
|
-
*
|
|
275
|
-
* collapseSpaces("a \u00A0b") // space followed by nbsp
|
|
276
|
-
* // → "a b" // keeps the first (regular space)
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
174
|
+
/** Collapse multiple spaces to single space. */
|
|
279
175
|
export function collapseSpaces(text) {
|
|
280
176
|
return text.replace(new RegExp(`(?<first>[ ${NBSP}])[ ${NBSP}]+`, "g"), "$<first>");
|
|
281
177
|
}
|
|
282
|
-
/**
|
|
283
|
-
* Converts repeated punctuation marks to Unicode ligature characters,
|
|
284
|
-
* squashing multiple marks to a single character.
|
|
285
|
-
*
|
|
286
|
-
* Handles:
|
|
287
|
-
* - "??" or "???" etc → "⁇" (squashed to double question mark ligature)
|
|
288
|
-
* - "?!" or "?!!" etc → "⁈" (question exclamation mark)
|
|
289
|
-
* - "!?" or "!??" etc → "⁉" (exclamation question mark)
|
|
290
|
-
* - "!!" or "!!!" etc → "!" (squashed to single exclamation)
|
|
291
|
-
*
|
|
292
|
-
* Note: These ligatures have poor font support, so this function is
|
|
293
|
-
* disabled by default.
|
|
294
|
-
*/
|
|
178
|
+
/** Convert ?? to ⁇, ?! to ⁈, !? to ⁉. Poor font support, disabled by default. */
|
|
295
179
|
export function punctuationLigatures(text, options = {}) {
|
|
296
180
|
const chr = options.separator
|
|
297
|
-
?
|
|
181
|
+
? escapeStringRegexp(options.separator)
|
|
298
182
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
299
183
|
// Order matters: handle mixed punctuation first, then repeated
|
|
300
184
|
// Patterns capture separators between characters and preserve them after the ligature
|
|
@@ -308,25 +192,7 @@ export function punctuationLigatures(text, options = {}) {
|
|
|
308
192
|
text = text.replace(new RegExp(`!(${chr})?!(?:${chr}?!)*`, "g"), (_match, sep) => "!" + (sep || ""));
|
|
309
193
|
return text;
|
|
310
194
|
}
|
|
311
|
-
/**
|
|
312
|
-
* Applies all symbol transformations.
|
|
313
|
-
*
|
|
314
|
-
* Runs in order:
|
|
315
|
-
* 1. ellipsis
|
|
316
|
-
* 2. multiplication
|
|
317
|
-
* 3. mathSymbols
|
|
318
|
-
* 4. legalSymbols
|
|
319
|
-
* 5. arrows
|
|
320
|
-
*
|
|
321
|
-
* Note: `degrees` and `fractions` are not included by default as they
|
|
322
|
-
* may be too aggressive for some use cases. Call them explicitly if needed.
|
|
323
|
-
*
|
|
324
|
-
* @example
|
|
325
|
-
* ```ts
|
|
326
|
-
* symbolTransform("Wait... 5x5 != 20 (c) 2024")
|
|
327
|
-
* // → "Wait… 5×5 ≠ 20 © 2024"
|
|
328
|
-
* ```
|
|
329
|
-
*/
|
|
195
|
+
/** Apply all symbol transforms. degrees/fractions excluded (too aggressive). */
|
|
330
196
|
export function symbolTransform(text, options = {}) {
|
|
331
197
|
text = ellipsis(text, options);
|
|
332
198
|
text = multiplication(text, options);
|
package/dist/symbols.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAS3G,MAAM,EACJ,QAAQ,EACR,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GAClB,GAAG,eAAe,CAAA;AAEnB,4BAA4B;AAC5B,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,UAAyB,EAAE;IAChE,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS;QAC3B,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC;QACvC,CAAC,CAAC,yBAAyB,CAAA;IAE7B,wDAAwD;IACxD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,OAAO,GAAG,SAAS,GAAG,OAAO,EAAE,GAAG,CAAC,CAAA;IAC9D,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC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B,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAA0B,GAAG,MAAM,CAM3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,MAA0B,EACrC,aAAa,GAAE,MAAoB,GAClC,IAAI,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAA0B,GAAG,MAAM,CAM3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,MAA0B,EACrC,aAAa,GAAE,MAAoB,GAClC,IAAI,CAUN"}
|
package/dist/utils.js
CHANGED
|
@@ -26,7 +26,9 @@ export function assertSeparatorCountPreserved(original, transformed, separator =
|
|
|
26
26
|
const originalCount = countSeparators(original, separator);
|
|
27
27
|
const transformedCount = countSeparators(transformed, separator);
|
|
28
28
|
if (originalCount !== transformedCount) {
|
|
29
|
-
throw new Error(`${transformName} altered separator count: expected ${originalCount}, got ${transformedCount}`
|
|
29
|
+
throw new Error(`${transformName} altered separator count: expected ${originalCount}, got ${transformedCount}.\n` +
|
|
30
|
+
`This is a bug in punctilio. Please file an issue at https://github.com/alexander-turner/punctilio/issues\n` +
|
|
31
|
+
`Include the input text that caused this error.`);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,YAAoB,iBAAiB;IACjF,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,EAAE,CAAA;IACjC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB,EAChB,WAAmB,EACnB,YAAoB,iBAAiB,EACrC,gBAAwB,WAAW;IAEnC,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC1D,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IAChE,IAAI,aAAa,KAAK,gBAAgB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,sCAAsC,aAAa,SAAS,gBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,YAAoB,iBAAiB;IACjF,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,EAAE,CAAA;IACjC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAgB,EAChB,WAAmB,EACnB,YAAoB,iBAAiB,EACrC,gBAAwB,WAAW;IAEnC,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC1D,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IAChE,IAAI,aAAa,KAAK,gBAAgB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,sCAAsC,aAAa,SAAS,gBAAgB,KAAK;YACjG,4GAA4G;YAC5G,gDAAgD,CACjD,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "punctilio",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Smart typography transformations: curly quotes, em-dashes, en-dashes, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
"typograf": "7.6.0",
|
|
56
56
|
"unified": "11.0.5"
|
|
57
57
|
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"escape-string-regexp": "5.0.0"
|
|
60
|
+
},
|
|
58
61
|
"scripts": {
|
|
59
62
|
"build": "tsc",
|
|
60
63
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|