@tolki/str 1.0.0 → 1.0.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/dist/ascii/index.d.ts +2 -4
- package/dist/ascii/index.d.ts.map +1 -1
- package/dist/base64/index.d.ts +2 -0
- package/dist/base64/index.d.ts.map +1 -1
- package/dist/markdown/index.d.ts +5 -8
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +21 -20
- package/dist/str.d.ts +36 -118
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +3 -2
- package/dist/ulid/index.d.ts +1 -5
- package/dist/ulid/index.d.ts.map +1 -1
- package/dist/uuid/index.d.ts +2 -5
- package/dist/uuid/index.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/ascii/index.d.ts
CHANGED
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
* @param value The value to transliterate.
|
|
5
5
|
* @return The transliterated ASCII string.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
7
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#afterLast
|
|
10
8
|
*
|
|
11
|
-
*
|
|
9
|
+
* @requires {@link https://www.npmjs.com/package/transliteration transliteration package}
|
|
12
10
|
*/
|
|
13
11
|
export declare function ascii(value: string): string;
|
|
14
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ascii/index.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ascii/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAChB,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAY,EACvB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAiB,GACnD,MAAM,CAwER"}
|
package/dist/base64/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
|
18
18
|
* @param value - The Base64 encoded string to decode.
|
|
19
19
|
* @param strict - Whether to enforce strict Base64 validation.
|
|
20
20
|
* @returns The decoded string or false if decoding fails.
|
|
21
|
+
*
|
|
22
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#frombase64
|
|
21
23
|
*/
|
|
22
24
|
export declare function fromBase64(value: string, strict?: boolean): string | false;
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base64/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgC9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAsBvD;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base64/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgC9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAsBvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACtB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,OAAe,GACxB,MAAM,GAAG,KAAK,CAqEhB"}
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface MarkDownOptions extends MarkdownItOptions {
|
|
|
3
3
|
gfm?: boolean;
|
|
4
4
|
anchors?: object | boolean;
|
|
5
5
|
typographer?: boolean;
|
|
6
|
+
allowUnsafeLinks?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export type MarkDownExtension = PluginSimple | PluginWithOptions<unknown> | [PluginWithOptions<unknown>, unknown];
|
|
8
9
|
export type MarkDownExtensions = MarkDownExtension[];
|
|
@@ -14,11 +15,9 @@ export type MarkDownExtensions = MarkDownExtension[];
|
|
|
14
15
|
* @param extensions - An array of markdown-it extensions to apply during rendering.
|
|
15
16
|
* @returns The resulting HTML string.
|
|
16
17
|
*
|
|
17
|
-
* @
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
18
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#markdown
|
|
20
19
|
*
|
|
21
|
-
*
|
|
20
|
+
* @requires {@link https://www.npmjs.com/package/markdown-it markdown-it package}
|
|
22
21
|
*/
|
|
23
22
|
export declare function markdown(value: string, options?: MarkDownOptions, extensions?: MarkDownExtensions): string;
|
|
24
23
|
/**
|
|
@@ -29,11 +28,9 @@ export declare function markdown(value: string, options?: MarkDownOptions, exten
|
|
|
29
28
|
* @param extensions - An array of markdown-it extensions to apply during rendering.
|
|
30
29
|
* @returns The resulting HTML string.
|
|
31
30
|
*
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
31
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#inlinemarkdown
|
|
35
32
|
*
|
|
36
|
-
*
|
|
33
|
+
* @requires {@link https://www.npmjs.com/package/markdown-it markdown-it package}
|
|
37
34
|
*/
|
|
38
35
|
export declare function inlineMarkdown(value: string, options?: MarkDownOptions, extensions?: MarkDownExtensions): string;
|
|
39
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown/index.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EACf,KAAK,OAAO,IAAI,iBAAiB,EACjC,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACzB,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACtD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown/index.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EACf,KAAK,OAAO,IAAI,iBAAiB,EACjC,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACzB,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACtD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,MAAM,iBAAiB,GACvB,YAAY,GACZ,iBAAiB,CAAC,OAAO,CAAC,GAC1B,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,EAAE,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAA+C,EACxD,UAAU,GAAE,kBAAuB,GACpC,MAAM,CAER;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAA+B,EACxC,UAAU,GAAE,kBAAuB,GACpC,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,GAAE,eAA+C,EACxD,UAAU,GAAE,kBAAuB,cAqCtC"}
|
package/dist/markdown/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { isArray as d } from "@tolki/utils";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
function
|
|
6
|
-
return s(
|
|
2
|
+
import p from "markdown-it";
|
|
3
|
+
import w from "markdown-it-anchor";
|
|
4
|
+
import g from "markdown-it-task-lists";
|
|
5
|
+
function A(e, n = { gfm: !0, anchors: !1 }, t = []) {
|
|
6
|
+
return s(n, t).render(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return s(
|
|
8
|
+
function L(e, n = { gfm: !0 }, t = []) {
|
|
9
|
+
return s(n, t).renderInline(e);
|
|
10
10
|
}
|
|
11
|
-
function s(
|
|
11
|
+
function s(e = { gfm: !0, anchors: !1 }, n = []) {
|
|
12
12
|
const {
|
|
13
13
|
html: t = !1,
|
|
14
|
-
linkify:
|
|
15
|
-
breaks:
|
|
16
|
-
gfm:
|
|
14
|
+
linkify: a = !0,
|
|
15
|
+
breaks: i = !0,
|
|
16
|
+
gfm: u = !0,
|
|
17
17
|
anchors: f = !1,
|
|
18
|
+
allowUnsafeLinks: l = !1,
|
|
18
19
|
...m
|
|
19
|
-
} =
|
|
20
|
-
|
|
21
|
-
for (const o of
|
|
20
|
+
} = e, r = new p({ html: t, linkify: a, breaks: i, ...m });
|
|
21
|
+
l && (r.validateLink = () => !0), u && r.use(g, { label: !0, labelAfter: !0 }), f && r.use(w, typeof f == "object" ? f : {});
|
|
22
|
+
for (const o of n)
|
|
22
23
|
if (d(o)) {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
} else o &&
|
|
26
|
-
return
|
|
24
|
+
const [c, k] = o;
|
|
25
|
+
r.use(c, k);
|
|
26
|
+
} else o && r.use(o);
|
|
27
|
+
return r;
|
|
27
28
|
}
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
L as inlineMarkdown,
|
|
30
31
|
s as markDownRenderer,
|
|
31
|
-
|
|
32
|
+
A as markdown
|
|
32
33
|
};
|
package/dist/str.d.ts
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
* @returns The portion of the string after the last occurrence of the search value
|
|
7
7
|
*
|
|
8
8
|
* @see https://tolki.abe.dev/strings/string-utilities-list.html#after
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
* after('A house on a lake', 'house '); -> 'on a lake'
|
|
13
9
|
*/
|
|
14
10
|
export declare function after(subject: string, search: string | number): string;
|
|
15
11
|
/**
|
|
@@ -28,6 +24,8 @@ export declare function afterLast(subject: string, search: string | number): str
|
|
|
28
24
|
* @param subject - The string to search in
|
|
29
25
|
* @param search - The value to search for
|
|
30
26
|
* @returns The portion of the string before the first occurrence of the search value
|
|
27
|
+
*
|
|
28
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#before
|
|
31
29
|
*/
|
|
32
30
|
export declare function before(subject: string, search: string | number): string;
|
|
33
31
|
/**
|
|
@@ -37,9 +35,7 @@ export declare function before(subject: string, search: string | number): string
|
|
|
37
35
|
* @param search - The value to search for
|
|
38
36
|
* @returns The portion of the string before the last occurrence of the search value
|
|
39
37
|
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
* beforeLast('yvette', 'tte'); -> 'yve'
|
|
38
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#beforelast
|
|
43
39
|
*/
|
|
44
40
|
export declare function beforeLast(subject: string, search: string | number): string;
|
|
45
41
|
/**
|
|
@@ -50,9 +46,7 @@ export declare function beforeLast(subject: string, search: string | number): st
|
|
|
50
46
|
* @param to - The ending value
|
|
51
47
|
* @returns The portion of the string between the two given values
|
|
52
48
|
*
|
|
53
|
-
* @
|
|
54
|
-
*
|
|
55
|
-
* between('foofoobar', 'foo', 'bar'); -> 'foo'
|
|
49
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#between
|
|
56
50
|
*/
|
|
57
51
|
export declare function between(subject: string, from: string | number, to: string | number): string;
|
|
58
52
|
/**
|
|
@@ -63,9 +57,7 @@ export declare function between(subject: string, from: string | number, to: stri
|
|
|
63
57
|
* @param to - The ending value
|
|
64
58
|
* @returns The smallest portion of the string between the two given values
|
|
65
59
|
*
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
68
|
-
* betweenFirst('foofoobar', 'foo', 'bar'); -> 'foo'
|
|
60
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#betweenfirst
|
|
69
61
|
*/
|
|
70
62
|
export declare function betweenFirst(subject: string, from: string | number, to: string | number): string;
|
|
71
63
|
/**
|
|
@@ -74,9 +66,7 @@ export declare function betweenFirst(subject: string, from: string | number, to:
|
|
|
74
66
|
* @param value - The string to convert
|
|
75
67
|
* @returns The camel-cased string
|
|
76
68
|
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
79
|
-
* camel('foo_bar'); -> 'fooBar'
|
|
69
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#camel
|
|
80
70
|
*/
|
|
81
71
|
export declare function camel(value: string): string;
|
|
82
72
|
/**
|
|
@@ -86,9 +76,7 @@ export declare function camel(value: string): string;
|
|
|
86
76
|
* @param index - The index of the character to get
|
|
87
77
|
* @returns The character at the specified index, or false if the index is out of bounds
|
|
88
78
|
*
|
|
89
|
-
* @
|
|
90
|
-
*
|
|
91
|
-
* charAt('hello', 1); -> 'e'
|
|
79
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#charat
|
|
92
80
|
*/
|
|
93
81
|
export declare function charAt(subject: string, index: number): string | false;
|
|
94
82
|
/**
|
|
@@ -98,9 +86,7 @@ export declare function charAt(subject: string, index: number): string | false;
|
|
|
98
86
|
* @param needle - The string or strings to remove
|
|
99
87
|
* @returns The string with the given string(s) removed from the start
|
|
100
88
|
*
|
|
101
|
-
* @
|
|
102
|
-
*
|
|
103
|
-
* chopStart('foobar', 'foo'); -> 'bar'
|
|
89
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#chopstart
|
|
104
90
|
*/
|
|
105
91
|
export declare function chopStart(subject: string, needle: string | string[]): string;
|
|
106
92
|
/**
|
|
@@ -110,9 +96,7 @@ export declare function chopStart(subject: string, needle: string | string[]): s
|
|
|
110
96
|
* @param needle - The string or strings to remove
|
|
111
97
|
* @returns The string with the given string(s) removed from the end
|
|
112
98
|
*
|
|
113
|
-
* @
|
|
114
|
-
*
|
|
115
|
-
* chopEnd('foobar', 'bar'); -> 'foo'
|
|
99
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#chopend
|
|
116
100
|
*/
|
|
117
101
|
export declare function chopEnd(subject: string, needle: string | string[]): string;
|
|
118
102
|
/**
|
|
@@ -122,11 +106,7 @@ export declare function chopEnd(subject: string, needle: string | string[]): str
|
|
|
122
106
|
* @param needles - The substring or substrings to search for
|
|
123
107
|
* @param ignoreCase - Whether to ignore case when searching
|
|
124
108
|
*
|
|
125
|
-
* @
|
|
126
|
-
*
|
|
127
|
-
* contains('Minion', 'ni'); -> true
|
|
128
|
-
* contains('Minion', 'Ni', true); -> true
|
|
129
|
-
* contains('Minion', 'Ni', false); -> false
|
|
109
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#contains
|
|
130
110
|
*/
|
|
131
111
|
export declare function contains(haystack: string, needles: string | Iterable<string>, ignoreCase?: boolean): boolean;
|
|
132
112
|
/**
|
|
@@ -137,8 +117,7 @@ export declare function contains(haystack: string, needles: string | Iterable<st
|
|
|
137
117
|
* @param options - Additional options for excerpt extraction
|
|
138
118
|
* @returns The extracted excerpt, or null if the phrase is not found
|
|
139
119
|
*
|
|
140
|
-
* @
|
|
141
|
-
* excerpt('The quick brown fox', 'brown', { radius: 5 });
|
|
120
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#excerpt
|
|
142
121
|
*/
|
|
143
122
|
export declare function excerpt(text: string | null, phrase?: string | null, options?: {
|
|
144
123
|
radius?: number;
|
|
@@ -152,10 +131,7 @@ export declare function excerpt(text: string | null, phrase?: string | null, opt
|
|
|
152
131
|
* @param ignoreCase - Whether to ignore case when searching
|
|
153
132
|
* @returns True if all substrings are found, false otherwise
|
|
154
133
|
*
|
|
155
|
-
* @
|
|
156
|
-
*
|
|
157
|
-
* containsAll('Taylor Otwell', ['taylor', 'otwell'], false); -> true
|
|
158
|
-
* containsAll('Taylor Otwell', ['taylor', 'xxx'], true); -> false
|
|
134
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#containsall
|
|
159
135
|
*/
|
|
160
136
|
export declare function containsAll(haystack: string, needles: Iterable<string>, ignoreCase?: boolean): boolean;
|
|
161
137
|
/**
|
|
@@ -166,11 +142,7 @@ export declare function containsAll(haystack: string, needles: Iterable<string>,
|
|
|
166
142
|
* @param ignoreCase - Whether to ignore case when searching
|
|
167
143
|
* @returns True if the substring is not found, false otherwise
|
|
168
144
|
*
|
|
169
|
-
* @
|
|
170
|
-
*
|
|
171
|
-
* doesntContain('Minion', 'ni'); -> false
|
|
172
|
-
* doesntContain('Minion', 'Ni', true); -> false
|
|
173
|
-
* doesntContain('Minion', 'Ni', false); -> true
|
|
145
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntcontain
|
|
174
146
|
*/
|
|
175
147
|
export declare function doesntContain(haystack: string, needles: string | Iterable<string>, ignoreCase?: boolean): boolean;
|
|
176
148
|
/**
|
|
@@ -180,12 +152,7 @@ export declare function doesntContain(haystack: string, needles: string | Iterab
|
|
|
180
152
|
* @param character - The character or characters to deduplicate
|
|
181
153
|
* @returns The string with consecutive instances of the character(s) replaced by a single instance
|
|
182
154
|
*
|
|
183
|
-
* @
|
|
184
|
-
*
|
|
185
|
-
* deduplicate('hello world'); -> 'hello world'
|
|
186
|
-
* deduplicate('hello---world', '-'); -> 'hello-world'
|
|
187
|
-
* deduplicate('hello___world', '_'); -> 'hello-world'
|
|
188
|
-
* deduplicate('hello world', ' '); -> 'hello world'
|
|
155
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#deduplicate
|
|
189
156
|
*/
|
|
190
157
|
export declare function deduplicate(value: string, character?: string | string[]): string;
|
|
191
158
|
/**
|
|
@@ -195,10 +162,7 @@ export declare function deduplicate(value: string, character?: string | string[]
|
|
|
195
162
|
* @param needles - The substring or substrings to search for
|
|
196
163
|
* @returns True if the string ends with any of the substrings, false otherwise
|
|
197
164
|
*
|
|
198
|
-
* @
|
|
199
|
-
*
|
|
200
|
-
* endsWith("Jason", "on"); -> true
|
|
201
|
-
* endsWith("Jason", "ON"); -> false
|
|
165
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#endswith
|
|
202
166
|
*/
|
|
203
167
|
export declare function endsWith(haystack: string | number | null, needles: string | number | Iterable<string>): boolean;
|
|
204
168
|
/**
|
|
@@ -208,10 +172,7 @@ export declare function endsWith(haystack: string | number | null, needles: stri
|
|
|
208
172
|
* @param needles - The substring or substrings to search for
|
|
209
173
|
* @returns True if the string does not end with any of the substrings, false otherwise
|
|
210
174
|
*
|
|
211
|
-
* @
|
|
212
|
-
*
|
|
213
|
-
* doesntEndWith("Jason", "on"); -> false
|
|
214
|
-
* doesntEndWith("Jason", "ON"); -> true
|
|
175
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntendwith
|
|
215
176
|
*/
|
|
216
177
|
export declare function doesntEndWith(haystack: string | number | null, needles: string | number | Iterable<string>): boolean;
|
|
217
178
|
/**
|
|
@@ -221,9 +182,7 @@ export declare function doesntEndWith(haystack: string | number | null, needles:
|
|
|
221
182
|
* @param cap - The string to cap with
|
|
222
183
|
* @returns The capped string
|
|
223
184
|
*
|
|
224
|
-
* @
|
|
225
|
-
*
|
|
226
|
-
* finish('hello', '!'); -> 'hello!'
|
|
185
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#finish
|
|
227
186
|
*/
|
|
228
187
|
export declare function finish(value: string, cap: string): string;
|
|
229
188
|
/**
|
|
@@ -260,11 +219,7 @@ export declare function unwrap(value: string, before: string, after?: string | n
|
|
|
260
219
|
* @param ignoreCase - Whether to ignore case when matching
|
|
261
220
|
* @return True if the string matches the pattern, false otherwise
|
|
262
221
|
*
|
|
263
|
-
* @
|
|
264
|
-
*
|
|
265
|
-
* is('hello', 'hello'); -> true
|
|
266
|
-
* is('hello', 'Hello', true); -> true
|
|
267
|
-
* is('hello', 'world'); -> false
|
|
222
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#is
|
|
268
223
|
*/
|
|
269
224
|
export declare function is(pattern: string | Iterable<string>, value: string | number, ignoreCase?: boolean): boolean;
|
|
270
225
|
/**
|
|
@@ -273,13 +228,7 @@ export declare function is(pattern: string | Iterable<string>, value: string | n
|
|
|
273
228
|
* @param value - The string to check
|
|
274
229
|
* @returns True if the string is ASCII, false otherwise
|
|
275
230
|
*
|
|
276
|
-
* @
|
|
277
|
-
*
|
|
278
|
-
* isAscii("Hello World"); -> true
|
|
279
|
-
* isAscii("こんにちは"); -> false
|
|
280
|
-
* isAscii("12345"); -> true
|
|
281
|
-
* isAscii("!@#$%"); -> true
|
|
282
|
-
* isAscii("Hello こんにちは"); -> false
|
|
231
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isascii
|
|
283
232
|
*/
|
|
284
233
|
export declare function isAscii(value: string): boolean;
|
|
285
234
|
/**
|
|
@@ -288,11 +237,7 @@ export declare function isAscii(value: string): boolean;
|
|
|
288
237
|
* @param value - The value to check if it's JSON
|
|
289
238
|
* @returns True if the value is valid JSON, false otherwise
|
|
290
239
|
*
|
|
291
|
-
* @
|
|
292
|
-
*
|
|
293
|
-
* isJson('{"name": "John", "age": 30}'); -> true
|
|
294
|
-
* isJson('{"name": "John", "age": 30'); -> false
|
|
295
|
-
* isJson('Hello World'); -> false
|
|
240
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isjson
|
|
296
241
|
*/
|
|
297
242
|
export declare function isJson(value: unknown): boolean;
|
|
298
243
|
/**
|
|
@@ -302,11 +247,7 @@ export declare function isJson(value: unknown): boolean;
|
|
|
302
247
|
* @param protocols - An optional array of allowed protocols (e.g., ['http', 'https'])
|
|
303
248
|
* @return True if the value is a valid URL, false otherwise
|
|
304
249
|
*
|
|
305
|
-
* @
|
|
306
|
-
*
|
|
307
|
-
* isUrl('https://laravel.com'); -> true
|
|
308
|
-
* isUrl('http://localhost'); -> true
|
|
309
|
-
* isUrl('invalid url'); -> false
|
|
250
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isurl
|
|
310
251
|
*/
|
|
311
252
|
export declare function isUrl(value: string | unknown, protocols?: string[]): boolean;
|
|
312
253
|
/**
|
|
@@ -315,9 +256,7 @@ export declare function isUrl(value: string | unknown, protocols?: string[]): bo
|
|
|
315
256
|
* @param value - The string to convert
|
|
316
257
|
* @returns The kebab-cased string
|
|
317
258
|
*
|
|
318
|
-
* @
|
|
319
|
-
*
|
|
320
|
-
* kebab("Laravel PHP Framework"); -> "laravel-php-framework"
|
|
259
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#kebab
|
|
321
260
|
*/
|
|
322
261
|
export declare function kebab(value: string): string;
|
|
323
262
|
/**
|
|
@@ -326,9 +265,7 @@ export declare function kebab(value: string): string;
|
|
|
326
265
|
* @param value - The string to measure
|
|
327
266
|
* @returns The length of the string
|
|
328
267
|
*
|
|
329
|
-
* @
|
|
330
|
-
*
|
|
331
|
-
* length("Hello World"); -> 11
|
|
268
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#length
|
|
332
269
|
*/
|
|
333
270
|
export declare function length(value: string): number;
|
|
334
271
|
/**
|
|
@@ -339,6 +276,8 @@ export declare function length(value: string): number;
|
|
|
339
276
|
* @param end - The string to append if the value is truncated
|
|
340
277
|
* @param preserveWords - Whether to preserve whole words when truncating
|
|
341
278
|
* @returns The limited string
|
|
279
|
+
*
|
|
280
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#limit
|
|
342
281
|
*/
|
|
343
282
|
export declare function limit(value: string, limit?: number, end?: string, preserveWords?: boolean): string;
|
|
344
283
|
/**
|
|
@@ -347,9 +286,7 @@ export declare function limit(value: string, limit?: number, end?: string, prese
|
|
|
347
286
|
* @param value - The string to convert
|
|
348
287
|
* @returns The lower-cased string
|
|
349
288
|
*
|
|
350
|
-
* @
|
|
351
|
-
*
|
|
352
|
-
* lower("Hello World"); -> "hello world"
|
|
289
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#lower
|
|
353
290
|
*/
|
|
354
291
|
export declare function lower(value: string): string;
|
|
355
292
|
/**
|
|
@@ -375,12 +312,7 @@ export declare function words(value: string, words?: number, end?: string): stri
|
|
|
375
312
|
* @param length - The number of characters to mask (if null, mask to the end of the string)
|
|
376
313
|
* @returns The masked string
|
|
377
314
|
*
|
|
378
|
-
* @
|
|
379
|
-
*
|
|
380
|
-
* mask("taylor@email.com", "*", 3); -> "tay*************"
|
|
381
|
-
* mask("taylor@email.com", "*", 0, 6); -> "******@email.com"
|
|
382
|
-
* mask("taylor@email.com", "*", -13); -> "tay*************"
|
|
383
|
-
* mask("taylor@email.com", "*", -13, 3); -> "tay***@email.com"
|
|
315
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#mask
|
|
384
316
|
*/
|
|
385
317
|
export declare function mask(value: string, character: string, index: number, length?: number | null): string;
|
|
386
318
|
/**
|
|
@@ -389,6 +321,8 @@ export declare function mask(value: string, character: string, index: number, le
|
|
|
389
321
|
* @param pattern - The regex pattern to match
|
|
390
322
|
* @param subject - The string to search within
|
|
391
323
|
* @returns The matched string or an empty string if no match
|
|
324
|
+
*
|
|
325
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#match
|
|
392
326
|
*/
|
|
393
327
|
export declare function match(pattern: string, subject: string): string;
|
|
394
328
|
/**
|
|
@@ -398,22 +332,17 @@ export declare function match(pattern: string, subject: string): string;
|
|
|
398
332
|
* @param value - The string to check
|
|
399
333
|
* @return True if the string matches the pattern, false otherwise
|
|
400
334
|
*
|
|
401
|
-
* @
|
|
402
|
-
*
|
|
403
|
-
* Str::isMatch('/foo/', 'foo bar'); // true
|
|
404
|
-
* Str::isMatch('/bar/', 'foo bar'); // false
|
|
335
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#ismatch
|
|
405
336
|
*/
|
|
406
337
|
export declare function isMatch(pattern: string | Iterable<string>, value: string): boolean;
|
|
407
338
|
/**
|
|
408
|
-
* Get the string matching the given pattern.
|
|
339
|
+
* Get the string(s) matching the given pattern.
|
|
409
340
|
*
|
|
410
341
|
* @param pattern - The regex pattern to match
|
|
411
342
|
* @param subject - The string to search within
|
|
412
343
|
* @returns An array of all matched strings
|
|
413
344
|
*
|
|
414
|
-
* @
|
|
415
|
-
*
|
|
416
|
-
* matchAll("/foo (.*)/", "foo bar baz"); -> ["foo bar baz"]
|
|
345
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#matchall
|
|
417
346
|
*/
|
|
418
347
|
export declare function matchAll(pattern: string, subject: string): string[];
|
|
419
348
|
/**
|
|
@@ -733,10 +662,7 @@ export declare function start(value: string, prefix: string): string;
|
|
|
733
662
|
* @param value - The string to convert
|
|
734
663
|
* @returns The converted string in headline case
|
|
735
664
|
*
|
|
736
|
-
* @
|
|
737
|
-
*
|
|
738
|
-
* headline("foo bar baz"); -> "Foo Bar Baz"
|
|
739
|
-
* headline("foO bAr BaZ"); -> "Foo Bar Baz"
|
|
665
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#headline
|
|
740
666
|
*/
|
|
741
667
|
export declare function headline(value: string): string;
|
|
742
668
|
/**
|
|
@@ -745,12 +671,8 @@ export declare function headline(value: string): string;
|
|
|
745
671
|
* @param value - The string to convert
|
|
746
672
|
* @returns The converted string in APA title case
|
|
747
673
|
*
|
|
674
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#apa
|
|
748
675
|
* @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
|
|
749
|
-
*
|
|
750
|
-
* @example
|
|
751
|
-
*
|
|
752
|
-
* apa("foo bar baz"); -> "Foo Bar Baz"
|
|
753
|
-
* apa("foO bAr BaZ"); -> "Foo Bar Baz"
|
|
754
676
|
*/
|
|
755
677
|
export declare function apa(value: string): string;
|
|
756
678
|
/**
|
|
@@ -795,9 +717,7 @@ export declare function startsWith(haystack: string | number | null, needles: st
|
|
|
795
717
|
* @param needles - The substring or substrings to search for
|
|
796
718
|
* @returns True if the haystack doesn't start with any of the needles, false otherwise
|
|
797
719
|
*
|
|
798
|
-
* @
|
|
799
|
-
*
|
|
800
|
-
* expect(doesntStartWith("jason", ["day"])).toBe(true);
|
|
720
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntstartwith
|
|
801
721
|
*/
|
|
802
722
|
export declare function doesntStartWith(haystack: string | number | null, needles: string | number | null | Iterable<string | number | null>): boolean;
|
|
803
723
|
/**
|
|
@@ -857,9 +777,7 @@ export declare function take(value: string, limit: number): string;
|
|
|
857
777
|
* @param value - The string to process
|
|
858
778
|
* @returns The resulting string with the first character in lowercase
|
|
859
779
|
*
|
|
860
|
-
* @
|
|
861
|
-
*
|
|
862
|
-
* lcfirst('Hello World'); -> 'hello World'
|
|
780
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#lcfirst
|
|
863
781
|
*/
|
|
864
782
|
export declare function lcfirst(value: string): string;
|
|
865
783
|
/**
|
package/dist/str.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../src/str.ts"],"names":[],"mappings":"AAgCA
|
|
1
|
+
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../src/str.ts"],"names":[],"mappings":"AAgCA;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAatE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAY1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAQvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,E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K,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE/C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CACnB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAM,GAAG,MAAM,EAAkB,GAC9C,MAAM,CAcR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACrB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAM,GAAG,IAAW,GACjC,MAAM,CAcR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,QAAQ,GAAE,MAAa,EACvB,YAAY,GAAE,OAAe,GAC9B,MAAM,CAsFR;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAIjC"}
|
package/dist/str.js
CHANGED
|
@@ -68,7 +68,7 @@ function B(t, e, n = !1) {
|
|
|
68
68
|
return !1;
|
|
69
69
|
}
|
|
70
70
|
function dt(t, e = "", n = {}) {
|
|
71
|
-
const r =
|
|
71
|
+
const { radius: r = 100, omission: o = "..." } = n, s = String(t ?? ""), c = e ?? "", i = (y) => y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(s);
|
|
72
72
|
if (!l)
|
|
73
73
|
return null;
|
|
74
74
|
const g = q(l[1] ?? ""), u = Array.from(g).length, m = x(g, Math.max(u - r, 0), r);
|
|
@@ -132,7 +132,8 @@ function bt(t, e, n = !1) {
|
|
|
132
132
|
}
|
|
133
133
|
function Lt(t) {
|
|
134
134
|
for (let e = 0; e < t.length; e++)
|
|
135
|
-
if (t.charCodeAt(e) > 127)
|
|
135
|
+
if (t.charCodeAt(e) > 127)
|
|
136
|
+
return !1;
|
|
136
137
|
return !0;
|
|
137
138
|
}
|
|
138
139
|
function Rt(t) {
|
package/dist/ulid/index.d.ts
CHANGED
|
@@ -69,11 +69,7 @@ export declare function freezeUlids(callback?: ((value: string) => string) | nul
|
|
|
69
69
|
* @param value - The value to check.
|
|
70
70
|
* @returns True if the value is a valid ULID, false otherwise.
|
|
71
71
|
*
|
|
72
|
-
* @
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
*
|
|
76
|
-
* isUlid("01F8MECHZX2D7J8F8C8D4B8F8C"); -> true
|
|
72
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isulid
|
|
77
73
|
*/
|
|
78
74
|
export declare function isUlid(value: unknown): boolean;
|
|
79
75
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ulid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ulid/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,IAAI,GAAG,MAAM,GAAG,IAAW,GAAG,MAAM,CAwB9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAAG,IAAI,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ulid/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,IAAI,GAAG,MAAM,GAAG,IAAW,GAAG,MAAM,CAwB9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAAG,IAAI,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQ9C"}
|
package/dist/uuid/index.d.ts
CHANGED
|
@@ -81,12 +81,9 @@ export declare function createUuidsNormally(): void;
|
|
|
81
81
|
* @param version - The UUID version to check against (1-8), "nil", "max", or null for any version.
|
|
82
82
|
* @returns True if the value is a valid UUID of the specified version, false otherwise.
|
|
83
83
|
*
|
|
84
|
-
* @
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
84
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isuuid
|
|
87
85
|
*
|
|
88
|
-
*
|
|
89
|
-
* isUuid("550e8400-e29b-41d4-a716-446655440000", 5); -> false
|
|
86
|
+
* @requires {@link https://www.npmjs.com/package/uuid uuid package}
|
|
90
87
|
*/
|
|
91
88
|
export declare function isUuid(value: string | unknown, version?: number | "nil" | "max" | null): boolean;
|
|
92
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/uuid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAAG,IAAI,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAAG,IAAI,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAClB,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,OAAO,GAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,IAAW,GAC9C,OAAO,CAkCT"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/str",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Utilities for working with strings similar to Laravel's Str & Stringable classes.",
|
|
5
5
|
"author": "Abraham Arango <https://github.com/abetwothree>",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://tolki.abe.dev/strings/",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/abetwothree/tolki.git",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
],
|
|
26
27
|
"sideEffects": false,
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@tolki/num": "^1.0.
|
|
29
|
+
"@tolki/num": "^1.0.1",
|
|
29
30
|
"@tolki/utils": "^1.0.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"markdown-it-anchor": "^9.2.0",
|
|
37
38
|
"markdown-it-task-lists": "^2.1.1",
|
|
38
39
|
"pluralize": "^8.0.0",
|
|
39
|
-
"transliteration": "^2.
|
|
40
|
+
"transliteration": "^2.6.0",
|
|
40
41
|
"ulid": "^2.4.0",
|
|
41
42
|
"uuid": "^11.1.0"
|
|
42
43
|
},
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"markdown-it-anchor": "^9.2.0",
|
|
49
50
|
"markdown-it-task-lists": "^2.1.1",
|
|
50
51
|
"pluralize": "^8.0.0",
|
|
51
|
-
"transliteration": "^2.
|
|
52
|
+
"transliteration": "^2.6.0",
|
|
52
53
|
"ulid": "^2.4.0",
|
|
53
54
|
"uuid": "^11.1.0"
|
|
54
55
|
},
|