@visulima/string 3.0.0-alpha.5 → 3.0.0-alpha.6
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 +19 -0
- package/LICENSE.md +1 -1
- package/dist/align-text.d.ts +7 -10
- package/dist/case/camel-case.d.ts +3 -5
- package/dist/case/camel-case.js +2 -2
- package/dist/case/capital-case.d.ts +3 -5
- package/dist/case/capital-case.js +2 -2
- package/dist/case/constant-case.d.ts +3 -5
- package/dist/case/dot-case.d.ts +3 -5
- package/dist/case/flat-case.d.ts +3 -5
- package/dist/case/flip-case.d.ts +4 -7
- package/dist/case/flip-case.js +1 -1
- package/dist/case/identify-case.d.ts +3 -5
- package/dist/case/index.d.ts +22 -24
- package/dist/case/index.js +1 -1
- package/dist/case/kebab-case.d.ts +6 -9
- package/dist/case/kebab-case.js +2 -2
- package/dist/case/lower-first.d.ts +3 -5
- package/dist/case/no-case.d.ts +3 -5
- package/dist/case/pascal-case.d.ts +3 -5
- package/dist/case/pascal-case.js +2 -2
- package/dist/case/pascal-snake-case.d.ts +3 -5
- package/dist/case/path-case.d.ts +3 -5
- package/dist/case/sentence-case.d.ts +3 -5
- package/dist/case/sentence-case.js +2 -2
- package/dist/case/snake-case.d.ts +3 -5
- package/dist/case/split-by-case.d.ts +11 -14
- package/dist/case/split-by-case.js +1 -1
- package/dist/case/title-case.d.ts +3 -5
- package/dist/case/train-case.d.ts +3 -5
- package/dist/case/train-case.js +1 -1
- package/dist/case/upper-first.d.ts +3 -5
- package/dist/closest-string.d.ts +3 -5
- package/dist/compare-similarity.d.ts +3 -5
- package/dist/get-string-truncated-width.d.ts +18 -20
- package/dist/get-string-truncated-width.js +96 -15
- package/dist/get-string-width.d.ts +2 -5
- package/dist/index.d.ts +39 -49
- package/dist/index.js +3 -3
- package/dist/native-string-types.d.ts +129 -128
- package/dist/outdent.d.ts +9 -11
- package/dist/outdent.js +1 -1
- package/dist/packem_shared/{constants-CnXdp6qx.js → constants-D5qaproB.js} +1 -1
- package/dist/packem_shared/{excerpt-GvmR4ESb.js → excerpt-BUidaKYe.js} +37 -37
- package/dist/packem_shared/{joinSegments-B4H6oZ9b.js → joinSegments-BStLas0c.js} +1 -1
- package/dist/packem_shared/lru-cache.d-BsP6kbVJ.d.ts +13 -0
- package/dist/packem_shared/{transliterate-a6LLM_Ei.js → transliterate-DGlx-woj.js} +1 -1
- package/dist/packem_shared/{types-D2ydhHCv.d.ts → types.d-BVNv675q.d.ts} +17 -20
- package/dist/packem_shared/{types-CHpmpy8C.d.ts → types.d-DfgbcNKh.d.ts} +19 -21
- package/dist/slice.d.ts +5 -8
- package/dist/slice.js +1 -1
- package/dist/slugify.d.ts +1 -3
- package/dist/slugify.js +1 -1
- package/dist/test/utils.d.ts +20 -22
- package/dist/test/utils.js +2 -2
- package/dist/test/vitest.d.ts +3 -6
- package/dist/truncate.d.ts +7 -10
- package/dist/utilities.d.ts +2 -4
- package/dist/word-similarity-sort.d.ts +3 -5
- package/dist/word-wrap.d.ts +9 -11
- package/dist/word-wrap.js +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/lru-cache-B_t27XwI.d.ts +0 -14
|
@@ -1,24 +1,105 @@
|
|
|
1
|
-
import { i as RE_ANSI, N as RE_CONTROL, j as RE_EMOJI } from './packem_shared/constants-
|
|
1
|
+
import { i as RE_ANSI, N as RE_CONTROL, j as RE_EMOJI } from './packem_shared/constants-D5qaproB.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
4
|
+
const fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
5
|
+
const halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
|
|
6
|
+
const narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
|
|
7
|
+
const wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
|
|
8
|
+
|
|
9
|
+
const isInRange = (ranges, codePoint) => {
|
|
10
|
+
let low = 0;
|
|
11
|
+
let high = Math.floor(ranges.length / 2) - 1;
|
|
12
|
+
while (low <= high) {
|
|
13
|
+
const mid = Math.floor((low + high) / 2);
|
|
14
|
+
const i = mid * 2;
|
|
15
|
+
if (codePoint < ranges[i]) {
|
|
16
|
+
high = mid - 1;
|
|
17
|
+
} else if (codePoint > ranges[i + 1]) {
|
|
18
|
+
low = mid + 1;
|
|
19
|
+
} else {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const minimumAmbiguousCodePoint = ambiguousRanges[0];
|
|
27
|
+
const maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
|
|
28
|
+
const minimumFullWidthCodePoint = fullwidthRanges[0];
|
|
29
|
+
const maximumFullWidthCodePoint = fullwidthRanges.at(-1);
|
|
30
|
+
const minimumHalfWidthCodePoint = halfwidthRanges[0];
|
|
31
|
+
const maximumHalfWidthCodePoint = halfwidthRanges.at(-1);
|
|
32
|
+
const minimumNarrowCodePoint = narrowRanges[0];
|
|
33
|
+
const maximumNarrowCodePoint = narrowRanges.at(-1);
|
|
34
|
+
const minimumWideCodePoint = wideRanges[0];
|
|
35
|
+
const maximumWideCodePoint = wideRanges.at(-1);
|
|
36
|
+
const commonCjkCodePoint = 19968;
|
|
37
|
+
const [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);
|
|
38
|
+
function findWideFastPathRange(ranges) {
|
|
39
|
+
let fastPathStart = ranges[0];
|
|
40
|
+
let fastPathEnd = ranges[1];
|
|
41
|
+
for (let index = 0; index < ranges.length; index += 2) {
|
|
42
|
+
const start = ranges[index];
|
|
43
|
+
const end = ranges[index + 1];
|
|
44
|
+
if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) {
|
|
45
|
+
return [start, end];
|
|
46
|
+
}
|
|
47
|
+
if (end - start > fastPathEnd - fastPathStart) {
|
|
48
|
+
fastPathStart = start;
|
|
49
|
+
fastPathEnd = end;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return [fastPathStart, fastPathEnd];
|
|
11
53
|
}
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
54
|
+
const isAmbiguous = (codePoint) => {
|
|
55
|
+
if (codePoint < minimumAmbiguousCodePoint || codePoint > maximumAmbiguousCodePoint) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return isInRange(ambiguousRanges, codePoint);
|
|
59
|
+
};
|
|
60
|
+
const isFullWidth = (codePoint) => {
|
|
61
|
+
if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return isInRange(fullwidthRanges, codePoint);
|
|
65
|
+
};
|
|
66
|
+
const isHalfWidth = (codePoint) => {
|
|
67
|
+
if (codePoint < minimumHalfWidthCodePoint || codePoint > maximumHalfWidthCodePoint) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return isInRange(halfwidthRanges, codePoint);
|
|
71
|
+
};
|
|
72
|
+
const isNarrow = (codePoint) => {
|
|
73
|
+
if (codePoint < minimumNarrowCodePoint || codePoint > maximumNarrowCodePoint) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return isInRange(narrowRanges, codePoint);
|
|
77
|
+
};
|
|
78
|
+
const isWide = (codePoint) => {
|
|
79
|
+
if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (codePoint < minimumWideCodePoint || codePoint > maximumWideCodePoint) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return isInRange(wideRanges, codePoint);
|
|
86
|
+
};
|
|
87
|
+
function getCategory(codePoint) {
|
|
88
|
+
if (isAmbiguous(codePoint)) {
|
|
89
|
+
return "ambiguous";
|
|
90
|
+
}
|
|
91
|
+
if (isFullWidth(codePoint)) {
|
|
92
|
+
return "fullwidth";
|
|
93
|
+
}
|
|
94
|
+
if (isHalfWidth(codePoint)) {
|
|
16
95
|
return "halfwidth";
|
|
17
96
|
}
|
|
18
|
-
if (
|
|
97
|
+
if (isNarrow(codePoint)) {
|
|
19
98
|
return "narrow";
|
|
20
99
|
}
|
|
21
|
-
if (isWide(
|
|
100
|
+
if (isWide(codePoint)) {
|
|
101
|
+
return "wide";
|
|
102
|
+
}
|
|
22
103
|
return "neutral";
|
|
23
104
|
}
|
|
24
105
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { StringTruncatedWidthOptions } from
|
|
2
|
-
|
|
1
|
+
import { StringTruncatedWidthOptions } from "./get-string-truncated-width.js";
|
|
3
2
|
type StringWidthOptions = Omit<StringTruncatedWidthOptions, "ellipsis" | "ellipsisWidth" | "limit">;
|
|
4
3
|
declare const getStringWidth: (input: string, options?: StringWidthOptions) => number;
|
|
5
|
-
|
|
6
|
-
export { getStringWidth };
|
|
7
|
-
export type { StringWidthOptions };
|
|
4
|
+
export { StringWidthOptions, getStringWidth };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,56 +1,46 @@
|
|
|
1
|
-
export { AlignTextOptions, alignText } from
|
|
2
|
-
export { default as camelCase } from
|
|
3
|
-
export { default as capitalCase } from
|
|
4
|
-
export { default as constantCase } from
|
|
5
|
-
export { default as dotCase } from
|
|
6
|
-
export { default as flatCase } from
|
|
7
|
-
export { FlipOptions, flipCase } from
|
|
8
|
-
export { default as identifyCase } from
|
|
9
|
-
export { KebabCaseOptions, kebabCase } from
|
|
10
|
-
export { default as lowerFirst } from
|
|
11
|
-
export { default as noCase } from
|
|
12
|
-
export { default as pascalCase } from
|
|
13
|
-
export { default as pascalSnakeCase } from
|
|
14
|
-
export { default as pathCase } from
|
|
15
|
-
export { default as sentenceCase } from
|
|
16
|
-
export { default as snakeCase } from
|
|
17
|
-
export { SplitOptions, splitByCase } from
|
|
18
|
-
export { default as titleCase } from
|
|
19
|
-
export { default as trainCase } from
|
|
20
|
-
export { a as CamelCase, b as CapitalCase, C as CaseOptions, c as ConstantCase, D as DotCase, F as FlatCase, d as FlipCase, I as IdentifyCase, K as KebabCase, L as LocaleOptions, e as LowerFirst, N as NoCase, P as PascalCase, f as PascalSnakeCase, g as PathCase, S as SentenceCase, h as SnakeCase, i as SplitByCase, T as TitleCase, j as TrainCase, U as UpperFirst } from
|
|
21
|
-
export { default as upperFirst } from
|
|
22
|
-
export { joinSegments } from
|
|
23
|
-
export { ClosestStringOptions, closestString } from
|
|
24
|
-
export { CompareSimilarityOptions, compareSimilarity } from
|
|
25
|
-
import { TruncateOptions } from
|
|
26
|
-
export { truncate } from
|
|
27
|
-
export { StringTruncatedWidthOptions, StringTruncatedWidthResult, getStringTruncatedWidth } from
|
|
28
|
-
export { StringWidthOptions, getStringWidth } from
|
|
29
|
-
export { Outdent, Options as OutdentOptions, outdent } from
|
|
30
|
-
import { O as OptionReplaceArray,
|
|
31
|
-
export { A as All,
|
|
32
|
-
export { SliceOptions, slice } from
|
|
33
|
-
export { default as slugify } from
|
|
34
|
-
export { escapeRegExp, findStringOccurrences, hasChinese, hasPunctuationOrSpace, inRange } from
|
|
35
|
-
export { WordSimilaritySortOptions, wordSimilaritySort } from
|
|
36
|
-
export { WordWrapOptions, WrapMode, wordWrap } from
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
export { type AlignTextOptions, alignText } from "./align-text.js";
|
|
2
|
+
export { default as camelCase } from "./case/camel-case.js";
|
|
3
|
+
export { default as capitalCase } from "./case/capital-case.js";
|
|
4
|
+
export { default as constantCase } from "./case/constant-case.js";
|
|
5
|
+
export { default as dotCase } from "./case/dot-case.js";
|
|
6
|
+
export { default as flatCase } from "./case/flat-case.js";
|
|
7
|
+
export { type FlipOptions, flipCase } from "./case/flip-case.js";
|
|
8
|
+
export { default as identifyCase } from "./case/identify-case.js";
|
|
9
|
+
export { type KebabCaseOptions, kebabCase } from "./case/kebab-case.js";
|
|
10
|
+
export { default as lowerFirst } from "./case/lower-first.js";
|
|
11
|
+
export { default as noCase } from "./case/no-case.js";
|
|
12
|
+
export { default as pascalCase } from "./case/pascal-case.js";
|
|
13
|
+
export { default as pascalSnakeCase } from "./case/pascal-snake-case.js";
|
|
14
|
+
export { default as pathCase } from "./case/path-case.js";
|
|
15
|
+
export { default as sentenceCase } from "./case/sentence-case.js";
|
|
16
|
+
export { default as snakeCase } from "./case/snake-case.js";
|
|
17
|
+
export { type SplitOptions, splitByCase } from "./case/split-by-case.js";
|
|
18
|
+
export { default as titleCase } from "./case/title-case.js";
|
|
19
|
+
export { default as trainCase } from "./case/train-case.js";
|
|
20
|
+
export { type a as CamelCase, type b as CapitalCase, type C as CaseOptions, type c as ConstantCase, type D as DotCase, type F as FlatCase, type d as FlipCase, type I as IdentifyCase, type K as KebabCase, type L as LocaleOptions, type e as LowerFirst, type N as NoCase, type P as PascalCase, type f as PascalSnakeCase, type g as PathCase, type S as SentenceCase, type h as SnakeCase, type i as SplitByCase, type T as TitleCase, type j as TrainCase, type U as UpperFirst } from "./packem_shared/types.d-DfgbcNKh.js";
|
|
21
|
+
export { default as upperFirst } from "./case/upper-first.js";
|
|
22
|
+
export { joinSegments } from "./case/index.js";
|
|
23
|
+
export { type ClosestStringOptions, closestString } from "./closest-string.js";
|
|
24
|
+
export { type CompareSimilarityOptions, compareSimilarity } from "./compare-similarity.js";
|
|
25
|
+
import { TruncateOptions } from "./truncate.js";
|
|
26
|
+
export { truncate } from "./truncate.js";
|
|
27
|
+
export { type StringTruncatedWidthOptions, type StringTruncatedWidthResult, getStringTruncatedWidth } from "./get-string-truncated-width.js";
|
|
28
|
+
export { type StringWidthOptions, getStringWidth } from "./get-string-width.js";
|
|
29
|
+
export { type Outdent, type Options as OutdentOptions, outdent } from "./outdent.js";
|
|
30
|
+
import { O as OptionReplaceArray, a as IntervalArray, b as OptionsTransliterate } from "./packem_shared/types.d-BVNv675q.js";
|
|
31
|
+
export { type A as All, type c as Any, type C as CharAt, type d as Charmap, type e as Concat, type E as EndsWith, type f as Includes, type g as Interval, type h as IsBooleanLiteral, type i as IsNumberLiteral, type I as IsStringLiteral, type j as IsStringLiteralArray, type J as Join, type L as Length, type M as Math, type N as NodeLocale, type k as OptionReplaceCombined, type l as OptionReplaceObject, type P as PadEnd, type m as PadStart, type R as Repeat, type n as Replace, type o as ReplaceAll, type p as Reverse, type q as Slice, type S as SlugifyOptions, type r as Split, type s as StartsWith, type T as ToLowerCase, type t as ToUpperCase, type u as Trim, type v as TrimEnd, type w as TrimStart } from "./packem_shared/types.d-BVNv675q.js";
|
|
32
|
+
export { type SliceOptions, slice } from "./slice.js";
|
|
33
|
+
export { default as slugify } from "./slugify.js";
|
|
34
|
+
export { escapeRegExp, findStringOccurrences, hasChinese, hasPunctuationOrSpace, inRange } from "./utilities.js";
|
|
35
|
+
export { type WordSimilaritySortOptions, wordSimilaritySort } from "./word-similarity-sort.js";
|
|
36
|
+
export { type WordWrapOptions, WrapMode, wordWrap } from "./word-wrap.js";
|
|
37
|
+
export { closest, distance } from 'fastest-levenshtein';
|
|
38
|
+
import "./packem_shared/lru-cache.d-BsP6kbVJ.js";
|
|
39
39
|
declare const countOccurrences: (value: string, substring: string) => number;
|
|
40
|
-
|
|
41
40
|
declare const direction: (value: string) => "rtl" | "ltr" | "neutral";
|
|
42
|
-
|
|
43
41
|
declare const excerpt: (html: string, limit: number, options?: ExcerptOptions) => string;
|
|
44
42
|
type ExcerptOptions = Omit<TruncateOptions, "position">;
|
|
45
|
-
|
|
46
|
-
declare const distance: (a: string, b: string) => number;
|
|
47
|
-
declare const closest: (str: string, arr: readonly string[]) => string;
|
|
48
|
-
|
|
49
43
|
declare const closestN: (string_: string, array: ReadonlyArray<string>, n: number) => (string | undefined)[];
|
|
50
|
-
|
|
51
44
|
declare const replaceString: (source: string, searches: OptionReplaceArray, ignoreRanges: IntervalArray) => string;
|
|
52
|
-
|
|
53
45
|
declare const transliterate: (source: string, options?: OptionsTransliterate) => string;
|
|
54
|
-
|
|
55
|
-
export { IntervalArray, OptionReplaceArray, OptionsTransliterate, TruncateOptions, closest, closestN, countOccurrences, direction, distance, excerpt, replaceString, transliterate };
|
|
56
|
-
export type { ExcerptOptions };
|
|
46
|
+
export { type ExcerptOptions, type IntervalArray, type OptionReplaceArray, type OptionsTransliterate, type TruncateOptions, closestN, countOccurrences, direction, excerpt, replaceString, transliterate };
|
package/dist/index.js
CHANGED
|
@@ -18,12 +18,12 @@ export { splitByCase } from './case/split-by-case.js';
|
|
|
18
18
|
export { default as titleCase } from './case/title-case.js';
|
|
19
19
|
export { default as trainCase } from './case/train-case.js';
|
|
20
20
|
export { default as upperFirst } from './case/upper-first.js';
|
|
21
|
-
export { default as joinSegments } from './packem_shared/joinSegments-
|
|
21
|
+
export { default as joinSegments } from './packem_shared/joinSegments-BStLas0c.js';
|
|
22
22
|
export { closestString } from './closest-string.js';
|
|
23
23
|
export { compareSimilarity } from './compare-similarity.js';
|
|
24
24
|
export { countOccurrences } from './packem_shared/countOccurrences-CS9XprQN.js';
|
|
25
25
|
export { direction } from './packem_shared/direction-BVhR8MOQ.js';
|
|
26
|
-
export { excerpt } from './packem_shared/excerpt-
|
|
26
|
+
export { excerpt } from './packem_shared/excerpt-BUidaKYe.js';
|
|
27
27
|
export { getStringTruncatedWidth } from './get-string-truncated-width.js';
|
|
28
28
|
export { getStringWidth } from './get-string-width.js';
|
|
29
29
|
export { closestN } from './packem_shared/closestN-Cvsw0Fue.js';
|
|
@@ -31,7 +31,7 @@ export { outdent } from './outdent.js';
|
|
|
31
31
|
export { default as replaceString } from './packem_shared/replaceString-BVlxk27d.js';
|
|
32
32
|
export { slice } from './slice.js';
|
|
33
33
|
export { default as slugify } from './slugify.js';
|
|
34
|
-
export { default as transliterate } from './packem_shared/transliterate-
|
|
34
|
+
export { default as transliterate } from './packem_shared/transliterate-DGlx-woj.js';
|
|
35
35
|
export { truncate } from './truncate.js';
|
|
36
36
|
export { escapeRegExp, findStringOccurrences, hasChinese, hasPunctuationOrSpace, inRange } from './utilities.js';
|
|
37
37
|
export { wordSimilaritySort } from './word-similarity-sort.js';
|
|
@@ -1,130 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type TupleOf<L extends number, T = unknown, Result extends any[] = []> = Result["length"] extends L ? Result : TupleOf<L, T, [...Result, T]>;
|
|
2
|
+
type InternalSliceType<T extends string, StartIndex extends number, EndIndex extends number, Result extends string = ""> = IsNumberLiteral<EndIndex | StartIndex> extends true ? T extends `${infer Head}${infer Rest}` ? IsStringLiteral<Head> extends true ? StartIndex extends 0 ? EndIndex extends 0 ? Result : InternalSliceType<Rest, 0, Math.Subtract<Math.GetPositiveIndex<T, EndIndex>, 1>, `${Result}${Head}`> : InternalSliceType<Rest, Math.Subtract<Math.GetPositiveIndex<T, StartIndex>, 1>, Math.Subtract<Math.GetPositiveIndex<T, EndIndex>, 1>, Result> : EndIndex | StartIndex extends 0 ? Result : string : IsStringLiteral<T> extends true ? Result : EndIndex | StartIndex extends 0 ? Result : string : string;
|
|
3
|
+
type SliceStartType<T extends string, StartIndex extends number, Result extends string = ""> = IsNumberLiteral<StartIndex> extends true ? T extends `${infer Head}${infer Rest}` ? IsStringLiteral<Head> extends true ? StartIndex extends 0 ? T : SliceStartType<Rest, Math.Subtract<Math.GetPositiveIndex<T, StartIndex>, 1>, Result> : string : IsStringLiteral<T> extends true ? Result : StartIndex extends 0 ? Result : string : string;
|
|
4
|
+
type InternalEndsWithType<T extends string, S extends string, P extends number> = All<[IsStringLiteral<S>, IsNumberLiteral<P>]> extends true ? Math.IsNegative<P> extends false ? P extends Length<T> ? IsStringLiteral<T> extends true ? S extends Slice<T, Math.Subtract<Length<T>, Length<S>>, Length<T>> ? true : false : EndsWithNoPositionType<Slice<T, 0, P>, S> : EndsWithNoPositionType<Slice<T, 0, P>, S> : false : boolean;
|
|
5
|
+
type EndsWithNoPositionType<T extends string, S extends string> = StartsWith<Reverse<T>, Reverse<S>>;
|
|
6
|
+
declare namespace Math {
|
|
7
|
+
type Subtract<A extends number, B extends number> = number extends A | B ? number : TupleOf<A> extends [...infer U, ...TupleOf<B>] ? U["length"] : 0;
|
|
8
|
+
type IsNegative<T extends number> = number extends T ? boolean : `${T}` extends `-${number}` ? true : false;
|
|
9
|
+
type Abs<T extends number> = `${T}` extends `-${infer U extends number}` ? U : T;
|
|
10
|
+
type GetPositiveIndex<T extends string, I extends number> = IsNegative<I> extends false ? I : Subtract<Length<T>, Abs<I>>;
|
|
11
|
+
}
|
|
12
|
+
type IsNumberLiteral<T extends number> = [T] extends [number] ? ([number] extends [T] ? false : true) : false;
|
|
13
|
+
type IsBooleanLiteral<T extends boolean> = [T] extends [boolean] ? ([boolean] extends [T] ? false : true) : false;
|
|
14
|
+
type Reverse<T extends string, Accumulator extends string = ""> = T extends `${infer Head}${infer Tail}` ? Reverse<Tail, `${Head}${Accumulator}`> : Accumulator extends "" ? T : `${T}${Accumulator}`;
|
|
15
|
+
type All<BoolArray extends boolean[]> = IsBooleanLiteral<BoolArray[number]> extends true ? BoolArray extends [infer Head extends boolean, ...infer Rest extends boolean[]] ? Head extends true ? All<Rest> : false : true : false;
|
|
16
|
+
type IsStringLiteral<T extends string> = [T] extends [string] ? [string] extends [T] ? false : Uppercase<T> extends Uppercase<Lowercase<T>> ? Lowercase<T> extends Lowercase<Uppercase<T>> ? true : false : false : false;
|
|
17
|
+
type IsStringLiteralArray<StringArray extends ReadonlyArray<string>> = IsStringLiteral<StringArray[number]> extends true ? true : false;
|
|
18
|
+
type CharAt<T extends string, Index extends number> = All<[IsStringLiteral<T>, IsNumberLiteral<Index>]> extends true ? Split<T>[Index] : string;
|
|
19
|
+
type Concat<T extends string[]> = Join<T>;
|
|
20
|
+
type EndsWith<T extends string, S extends string, P extends number | undefined = undefined> = P extends number ? InternalEndsWithType<T, S, P> : EndsWithNoPositionType<T, S>;
|
|
21
|
+
type Includes<T extends string, S extends string, P extends number = 0> = string extends S | T ? boolean : Math.IsNegative<P> extends false ? P extends 0 ? T extends `${string}${S}${string}` ? true : false : Includes<Slice<T, P>, S> : Includes<T, S>;
|
|
22
|
+
type Join<T extends ReadonlyArray<string>, Delimiter extends string = ""> = All<[IsStringLiteralArray<T>, IsStringLiteral<Delimiter>]> extends true ? T extends readonly [infer First extends string, ...infer Rest extends string[]] ? Rest extends [] ? First : `${First}${Delimiter}${Join<Rest, Delimiter>}` : "" : string;
|
|
23
|
+
type Length<T extends string> = IsStringLiteral<T> extends true ? Split<T>["length"] : number;
|
|
24
|
+
type PadEnd<T extends string, Times extends number = 0, Pad extends string = " "> = All<[IsStringLiteral<Pad | T>, IsNumberLiteral<Times>]> extends true ? Math.IsNegative<Times> extends false ? Math.Subtract<Times, Length<T>> extends infer Missing extends number ? `${T}${Slice<Repeat<Pad, Missing>, 0, Missing>}` : never : T : string;
|
|
25
|
+
type PadStart<T extends string, Times extends number = 0, Pad extends string = " "> = All<[IsStringLiteral<Pad | T>, IsNumberLiteral<Times>]> extends true ? Math.IsNegative<Times> extends false ? Math.Subtract<Times, Length<T>> extends infer Missing extends number ? `${Slice<Repeat<Pad, Missing>, 0, Missing>}${T}` : never : T : string;
|
|
26
|
+
type Repeat<T extends string, Times extends number = 0> = All<[IsStringLiteral<T>, IsNumberLiteral<Times>]> extends true ? Times extends 0 ? "" : Math.IsNegative<Times> extends false ? Join<TupleOf<Times, T>> : never : string;
|
|
27
|
+
type ReplaceAll<Sentence extends string, Lookup extends RegExp | string, Replacement extends string = ""> = Lookup extends string ? IsStringLiteral<Lookup | Replacement | Sentence> extends true ? Sentence extends `${infer Rest}${Lookup}${infer Rest2}` ? `${Rest}${Replacement}${ReplaceAll<Rest2, Lookup, Replacement>}` : Sentence : string : string;
|
|
28
|
+
type Replace<Sentence extends string, Lookup extends RegExp | string, Replacement extends string = ""> = Lookup extends string ? IsStringLiteral<Lookup | Replacement | Sentence> extends true ? Sentence extends `${infer Rest}${Lookup}${infer Rest2}` ? `${Rest}${Replacement}${Rest2}` : Sentence : string : string;
|
|
29
|
+
type Slice<T extends string, StartIndex extends number = 0, EndIndex extends number | undefined = undefined> = EndIndex extends number ? InternalSliceType<T, StartIndex, EndIndex> : SliceStartType<T, StartIndex>;
|
|
30
|
+
type Split<T extends string, Delimiter extends string = ""> = IsStringLiteral<Delimiter | T> extends true ? T extends `${infer First}${Delimiter}${infer Rest}` ? [First, ...Split<Rest, Delimiter>] : T extends "" ? [] : [T] : string[];
|
|
31
|
+
type StartsWith<T extends string, S extends string, P extends number = 0> = All<[IsStringLiteral<S>, IsNumberLiteral<P>]> extends true ? Math.IsNegative<P> extends false ? P extends 0 ? S extends `${infer SHead}${infer SRest}` ? T extends `${infer THead}${infer TRest}` ? IsStringLiteral<SHead | THead> extends true ? THead extends SHead ? StartsWith<TRest, SRest> : false : boolean : IsStringLiteral<T> extends true ? false : boolean : true : StartsWith<Slice<T, P>, S> : StartsWith<T, S> : boolean;
|
|
32
|
+
type TrimEnd<T extends string> = T extends `${infer Rest} ` ? TrimEnd<Rest> : T;
|
|
33
|
+
type TrimStart<T extends string> = T extends ` ${infer Rest}` ? TrimStart<Rest> : T;
|
|
34
|
+
type Trim<T extends string> = TrimEnd<TrimStart<T>>;
|
|
35
|
+
type ToLowerCase<T extends string> = IsStringLiteral<T> extends true ? Lowercase<T> : string;
|
|
36
|
+
type ToUpperCase<T extends string> = IsStringLiteral<T> extends true ? Uppercase<T> : string;
|
|
5
37
|
declare global {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
100
|
-
* same as the corresponding elements of this object (converted to a String) starting at
|
|
101
|
-
* position. Otherwise returns false.
|
|
102
|
-
*/
|
|
103
|
-
startsWith<T extends string = string, S extends string = string, P extends number = 0>(this: T, searchString: S, position?: P): StartsWith<T, S, P>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Converts all alphabetic characters in a string to lowercase.
|
|
107
|
-
*/
|
|
108
|
-
toLowerCase<T extends string = string>(this: T): ToLowerCase<T>;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Converts all alphabetic characters in a string to uppercase.
|
|
112
|
-
*/
|
|
113
|
-
toUpperCase<T extends string = string>(this: T): ToUpperCase<T>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Returns a string with all whitespace removed from both ends of a string.
|
|
117
|
-
*/
|
|
118
|
-
trim<T extends string = string>(this: T): Trim<T>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Returns a string with all whitespace removed from the end of a string.
|
|
122
|
-
*/
|
|
123
|
-
trimEnd<T extends string = string>(this: T): TrimEnd<T>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Returns a string with all whitespace removed from the start of a string.
|
|
127
|
-
*/
|
|
128
|
-
trimStart<T extends string = string>(this: T): TrimStart<T>;
|
|
129
|
-
}
|
|
38
|
+
interface String {
|
|
39
|
+
/**
|
|
40
|
+
* Returns the character at the specified index.
|
|
41
|
+
* @param index The zero-based index of the desired character.
|
|
42
|
+
*/
|
|
43
|
+
charAt<T extends string = string, I extends number = number>(this: T, index: I): CharAt<T, I>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a string that contains the concatenation of two or more strings.
|
|
46
|
+
* @param strings The strings to append to the end of the string.
|
|
47
|
+
*/
|
|
48
|
+
concat<T extends string = string, S extends string[] | string = string>(this: T, ...strings: S extends string ? [S] : S extends string[] ? S : never): S extends string ? Concat<[T, S]> : S extends string[] ? Concat<[T, ...S]> : never;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
51
|
+
* same as the corresponding elements of this object (converted to a String) starting at
|
|
52
|
+
* position. Otherwise returns false.
|
|
53
|
+
*/
|
|
54
|
+
endsWith<T extends string = string, S extends string = string, P extends number | undefined = undefined>(this: T, searchString: S, position?: P): EndsWith<T, S, P>;
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if searchString appears as a substring of the result of converting this
|
|
57
|
+
* object to a String, at one or more positions that are greater than or equal to
|
|
58
|
+
* position; otherwise, returns false.
|
|
59
|
+
* @param searchString
|
|
60
|
+
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
|
61
|
+
*/
|
|
62
|
+
includes<T extends string = string, S extends string = string, P extends number = 0>(this: T, searchString: S, position?: P): Includes<T, S, P>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the length of a String object.
|
|
65
|
+
*/
|
|
66
|
+
length: Length<this>;
|
|
67
|
+
/**
|
|
68
|
+
* Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
|
|
69
|
+
* The padding is applied from the end (right) of the current string.
|
|
70
|
+
* @param maxLength The length of the resulting string once the current string has been padded.
|
|
71
|
+
* @param fillString The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied.
|
|
72
|
+
*/
|
|
73
|
+
padEnd<T extends string = string, N extends number = number, P extends string = " ">(this: T, maxLength: N, fillString?: P): PadEnd<T, N, P>;
|
|
74
|
+
/**
|
|
75
|
+
* Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
|
|
76
|
+
* The padding is applied from the start (left) of the current string.
|
|
77
|
+
* @param maxLength The length of the resulting string once the current string has been padded.
|
|
78
|
+
* @param fillString The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied.
|
|
79
|
+
*/
|
|
80
|
+
padStart<T extends string = string, N extends number = number, P extends string = " ">(this: T, maxLength: N, fillString?: P): PadStart<T, N, P>;
|
|
81
|
+
/**
|
|
82
|
+
* Replace text in a string, using a regular expression or search string.
|
|
83
|
+
* @param searchValue A string to search for.
|
|
84
|
+
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
|
85
|
+
*/
|
|
86
|
+
replace<T extends string = string, S extends RegExp | string = string, R extends string = string>(this: T, searchValue: S, replaceValue: R): Replace<T, S, R>;
|
|
87
|
+
/**
|
|
88
|
+
* Replace all instances of a substring in a string, using a regular expression or search string.
|
|
89
|
+
* @param searchValue A string to search for.
|
|
90
|
+
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
|
91
|
+
*/
|
|
92
|
+
replaceAll<T extends string = string, S extends RegExp | string = string, R extends string = string>(this: T, searchValue: S, replaceValue: R): ReplaceAll<T, S, R>;
|
|
93
|
+
/**
|
|
94
|
+
* Returns a section of a string.
|
|
95
|
+
* @param start The index to the beginning of the specified portion of stringObj.
|
|
96
|
+
* @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
|
|
97
|
+
*/
|
|
98
|
+
slice<T extends string = string, S extends number = number, E extends number | undefined = undefined>(this: T, start?: S, end?: E): Slice<T, S, E>;
|
|
99
|
+
/**
|
|
100
|
+
* Split a string into substrings using the specified separator and return them as an array.
|
|
101
|
+
* @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
|
|
102
|
+
*/
|
|
103
|
+
split<T extends string = string, S extends string = string>(this: T, separator: S): Split<T, S>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
106
|
+
* same as the corresponding elements of this object (converted to a String) starting at
|
|
107
|
+
* position. Otherwise returns false.
|
|
108
|
+
*/
|
|
109
|
+
startsWith<T extends string = string, S extends string = string, P extends number = 0>(this: T, searchString: S, position?: P): StartsWith<T, S, P>;
|
|
110
|
+
/**
|
|
111
|
+
* Converts all alphabetic characters in a string to lowercase.
|
|
112
|
+
*/
|
|
113
|
+
toLowerCase<T extends string = string>(this: T): ToLowerCase<T>;
|
|
114
|
+
/**
|
|
115
|
+
* Converts all alphabetic characters in a string to uppercase.
|
|
116
|
+
*/
|
|
117
|
+
toUpperCase<T extends string = string>(this: T): ToUpperCase<T>;
|
|
118
|
+
/**
|
|
119
|
+
* Returns a string with all whitespace removed from both ends of a string.
|
|
120
|
+
*/
|
|
121
|
+
trim<T extends string = string>(this: T): Trim<T>;
|
|
122
|
+
/**
|
|
123
|
+
* Returns a string with all whitespace removed from the end of a string.
|
|
124
|
+
*/
|
|
125
|
+
trimEnd<T extends string = string>(this: T): TrimEnd<T>;
|
|
126
|
+
/**
|
|
127
|
+
* Returns a string with all whitespace removed from the start of a string.
|
|
128
|
+
*/
|
|
129
|
+
trimStart<T extends string = string>(this: T): TrimStart<T>;
|
|
130
|
+
}
|
|
130
131
|
}
|
package/dist/outdent.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
declare const outdent: Outdent;
|
|
2
2
|
interface Outdent {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
(strings: TemplateStringsArray, ...values: any[]): string;
|
|
4
|
+
(options: Options): Outdent;
|
|
5
|
+
string: (string_: string) => string;
|
|
6
6
|
}
|
|
7
7
|
interface Options {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
cache?: boolean;
|
|
9
|
+
cacheStore?: WeakMap<TemplateStringsArray, string[]>;
|
|
10
|
+
newline?: string | null;
|
|
11
|
+
trimLeadingNewline?: boolean;
|
|
12
|
+
trimTrailingNewline?: boolean;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
export { outdent };
|
|
16
|
-
export type { Options, Outdent };
|
|
14
|
+
export { Options, Outdent, outdent };
|
package/dist/outdent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RE_LEADING_NEWLINE, b as RE_TRAILING_NEWLINE, c as RE_ONLY_WHITESPACE_WITH_AT_LEAST_ONE_NEWLINE, d as RE_STARTS_WITH_NEWLINE_OR_IS_EMPTY, e as
|
|
1
|
+
import { a as RE_LEADING_NEWLINE, b as RE_TRAILING_NEWLINE, c as RE_ONLY_WHITESPACE_WITH_AT_LEAST_ONE_NEWLINE, d as RE_STARTS_WITH_NEWLINE_OR_IS_EMPTY, e as RE_MATCH_NEWLINES, f as RE_DETECT_INDENTATION } from './packem_shared/constants-D5qaproB.js';
|
|
2
2
|
|
|
3
3
|
const hop = Object.prototype.hasOwnProperty;
|
|
4
4
|
const has = (object, property) => hop.call(object, property);
|
|
@@ -92,4 +92,4 @@ const RE_TIBETAN = new RegExp("\\p{Script=Tibetan}", "u");
|
|
|
92
92
|
const RE_UZBEK_LATIN_MODIFIER = /[\u02BB\u02BC\u0027]/u;
|
|
93
93
|
const stripEmoji = (stringValue) => stringValue.replace(RE_EMOJI, "");
|
|
94
94
|
|
|
95
|
-
export {
|
|
95
|
+
export { RE_GURMUKHI as A, RE_KANNADA as B, RE_TAMIL as C, RE_TELUGU as D, RE_MALAYALAM as E, RE_SINHALA as F, RE_THAI as G, RE_LAO as H, RE_TIBETAN as I, RE_MYANMAR as J, RE_ETHIOPIC as K, RE_KHMER as L, RE_ORIYA as M, RE_CONTROL as N, ESCAPES as O, ANSI_ESCAPE_LINK as P, ANSI_SGR_TERMINATOR as Q, RE_FAST_ANSI as R, ANSI_ESCAPE_BELL as S, ANSI_CSI as T, RE_ESCAPE_PATTERN as U, ANSI_RESET_CODES as V, END_CODE as W, RE_ZERO_WIDTH as X, RE_LEADING_NEWLINE as a, RE_TRAILING_NEWLINE as b, RE_ONLY_WHITESPACE_WITH_AT_LEAST_ONE_NEWLINE as c, RE_STARTS_WITH_NEWLINE_OR_IS_EMPTY as d, RE_MATCH_NEWLINES as e, RE_DETECT_INDENTATION as f, RE_VALID_ANSI_PAIRS as g, RE_VALID_HYPERLINKS as h, RE_ANSI as i, RE_EMOJI as j, RE_CYRILLIC as k, RE_LATIN as l, RE_GREEK as m, RE_GREEK_LATIN_SPLIT as n, RE_UZBEK_LATIN_MODIFIER as o, RE_KATAKANA as p, RE_KANJI as q, RE_HIRAGANA as r, stripEmoji as s, RE_HANGUL as t, RE_HEBREW as u, RE_ARABIC as v, RE_SEPARATORS as w, RE_DEVANAGARI as x, RE_BENGALI as y, RE_GUJARATI as z };
|