@zinaid/str 0.0.6 → 0.0.7
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 +5 -0
- package/dist/ascii/index.d.ts.map +1 -1
- package/dist/base64/index.d.ts +16 -0
- package/dist/base64/index.d.ts.map +1 -1
- package/dist/base64/index.js +52 -51
- package/dist/convertcase/index.d.ts +10 -0
- package/dist/convertcase/index.d.ts.map +1 -1
- package/dist/index.js +106 -105
- package/dist/markdown/index.d.ts +23 -0
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/pluralizer/index.d.ts +61 -0
- package/dist/pluralizer/index.d.ts.map +1 -1
- package/dist/pluralizer/index.js +36 -27
- package/dist/replacer/index.d.ts +14 -14
- package/dist/str.d.ts +300 -60
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +182 -198
- package/dist/stringable/index.d.ts +398 -1
- package/dist/stringable/index.d.ts.map +1 -1
- package/dist/stringable/index.js +400 -13
- package/dist/transliterate/index.d.ts +5 -0
- package/dist/transliterate/index.d.ts.map +1 -1
- package/dist/trimmer/index.d.ts +21 -0
- package/dist/trimmer/index.d.ts.map +1 -1
- package/dist/ulid/index.d.ts +38 -0
- package/dist/ulid/index.d.ts.map +1 -1
- package/dist/ulid/index.js +37 -29
- package/dist/uuid/index.d.ts +34 -0
- package/dist/uuid/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/ascii/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Transliterate a UTF-8 value to ASCII.
|
|
3
3
|
*
|
|
4
|
+
* @param value The value to transliterate.
|
|
5
|
+
* @return The transliterated ASCII string.
|
|
6
|
+
*
|
|
7
|
+
* @requires {@link https://www.npmjs.com/package/transliteration transliteration package}
|
|
8
|
+
*
|
|
4
9
|
* @example
|
|
5
10
|
*
|
|
6
11
|
* ascii('Héllo Wörld'); -> 'Hello World'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ascii/index.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ascii/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
package/dist/base64/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert the given string to Base64 encoding.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The string to encode.
|
|
5
|
+
* @returns The Base64 encoded string.
|
|
6
|
+
*/
|
|
1
7
|
export declare function toBase64(value: string): string;
|
|
2
8
|
/**
|
|
3
9
|
* Convert raw bytes to a Base64 string using the same fallbacks as toBase64.
|
|
10
|
+
*
|
|
11
|
+
* @param bytes - The bytes to encode.
|
|
12
|
+
* @returns The Base64 encoded string.
|
|
4
13
|
*/
|
|
5
14
|
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
15
|
+
/**
|
|
16
|
+
* Decode the given Base64 encoded string.
|
|
17
|
+
*
|
|
18
|
+
* @param value - The Base64 encoded string to decode.
|
|
19
|
+
* @param strict - Whether to enforce strict Base64 validation.
|
|
20
|
+
* @returns The decoded string or false if decoding fails.
|
|
21
|
+
*/
|
|
6
22
|
export declare function fromBase64(value: string, strict?: boolean): string | false;
|
|
7
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base64/index.ts"],"names":[],"mappings":"
|
|
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;;;;;;GAMG;AACH,wBAAgB,UAAU,CACtB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,OAAe,GACxB,MAAM,GAAG,KAAK,CAqEhB"}
|
package/dist/base64/index.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { isFunction as l } from "@zinaid/utils";
|
|
2
|
+
function S(r) {
|
|
3
|
+
const o = h();
|
|
4
|
+
if (o.Buffer && l(o.Buffer.from))
|
|
5
|
+
return o.Buffer.from(r, "utf8").toString("base64");
|
|
6
|
+
if (l(o.btoa))
|
|
6
7
|
try {
|
|
7
|
-
const t =
|
|
8
|
+
const t = d(r);
|
|
8
9
|
return o.btoa(t);
|
|
9
10
|
} catch {
|
|
10
|
-
return o.btoa(
|
|
11
|
+
return o.btoa(r);
|
|
11
12
|
}
|
|
12
|
-
const e =
|
|
13
|
-
return
|
|
13
|
+
const e = d(r);
|
|
14
|
+
return p(e);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const o =
|
|
17
|
-
if (o.Buffer &&
|
|
18
|
-
return o.Buffer.from(
|
|
16
|
+
function T(r) {
|
|
17
|
+
const o = h();
|
|
18
|
+
if (o.Buffer && l(o.Buffer.from))
|
|
19
|
+
return o.Buffer.from(r).toString("base64");
|
|
19
20
|
let e = "";
|
|
20
|
-
for (let t = 0; t <
|
|
21
|
-
e += String.fromCharCode(
|
|
22
|
-
return
|
|
21
|
+
for (let t = 0; t < r.length; t++)
|
|
22
|
+
e += String.fromCharCode(r[t]);
|
|
23
|
+
return l(o.btoa) ? o.btoa(e) : p(e);
|
|
23
24
|
}
|
|
24
|
-
function y(
|
|
25
|
-
const e =
|
|
26
|
-
let t = String(
|
|
25
|
+
function y(r, o = !1) {
|
|
26
|
+
const e = h();
|
|
27
|
+
let t = String(r);
|
|
27
28
|
if (o) {
|
|
28
29
|
const c = t.replace(/\s+/g, "");
|
|
29
30
|
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c))
|
|
@@ -31,13 +32,13 @@ function y(n, o = !1) {
|
|
|
31
32
|
t = c;
|
|
32
33
|
} else
|
|
33
34
|
t = t.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
34
|
-
if (e.Buffer &&
|
|
35
|
+
if (e.Buffer && l(e.Buffer.from))
|
|
35
36
|
try {
|
|
36
37
|
return e.Buffer.from(t, "base64").toString("utf8");
|
|
37
38
|
} catch {
|
|
38
39
|
return !1;
|
|
39
40
|
}
|
|
40
|
-
if (
|
|
41
|
+
if (l(e.atob))
|
|
41
42
|
try {
|
|
42
43
|
const c = e.atob(t);
|
|
43
44
|
if (typeof e.TextDecoder == "function") {
|
|
@@ -46,68 +47,68 @@ function y(n, o = !1) {
|
|
|
46
47
|
f[a] = c.charCodeAt(a);
|
|
47
48
|
return new e.TextDecoder("utf-8").decode(f);
|
|
48
49
|
}
|
|
49
|
-
let
|
|
50
|
+
let n = "";
|
|
50
51
|
for (let f = 0; f < c.length; f++)
|
|
51
|
-
|
|
52
|
-
return decodeURIComponent(
|
|
52
|
+
n += "%" + c.charCodeAt(f).toString(16).padStart(2, "0");
|
|
53
|
+
return decodeURIComponent(n);
|
|
53
54
|
} catch {
|
|
54
55
|
return !1;
|
|
55
56
|
}
|
|
56
57
|
try {
|
|
57
|
-
const c =
|
|
58
|
+
const c = m(t);
|
|
58
59
|
return C(c);
|
|
59
60
|
} catch {
|
|
60
61
|
return !1;
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function h() {
|
|
64
65
|
return globalThis;
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
return encodeURIComponent(
|
|
67
|
+
function d(r) {
|
|
68
|
+
return encodeURIComponent(r).replace(
|
|
68
69
|
/%([0-9A-F]{2})/g,
|
|
69
70
|
(o, e) => String.fromCharCode(parseInt(e, 16))
|
|
70
71
|
);
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function p(r) {
|
|
73
74
|
const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
74
75
|
let e = "";
|
|
75
|
-
for (let t = 0; t <
|
|
76
|
-
const c =
|
|
77
|
-
isNaN(
|
|
76
|
+
for (let t = 0; t < r.length; t += 3) {
|
|
77
|
+
const c = r.charCodeAt(t), n = r.charCodeAt(t + 1), f = r.charCodeAt(t + 2), a = (c ?? 0) << 16 | (n ?? 0) << 8 | (f ?? 0), i = a >> 18 & 63, s = a >> 12 & 63, u = a >> 6 & 63, g = a & 63;
|
|
78
|
+
isNaN(n) ? e += o.charAt(i) + o.charAt(s) + "==" : isNaN(f) ? e += o.charAt(i) + o.charAt(s) + o.charAt(u) + "=" : e += o.charAt(i) + o.charAt(s) + o.charAt(u) + o.charAt(g);
|
|
78
79
|
}
|
|
79
80
|
return e;
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function m(r) {
|
|
82
83
|
const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = /* @__PURE__ */ new Map();
|
|
83
|
-
for (let
|
|
84
|
-
e.set(o[
|
|
85
|
-
const t =
|
|
86
|
-
for (let
|
|
87
|
-
const f = e.has(t[
|
|
88
|
-
c.push(
|
|
84
|
+
for (let n = 0; n < o.length; n++)
|
|
85
|
+
e.set(o[n], n);
|
|
86
|
+
const t = r.replace(/=+$/g, ""), c = [];
|
|
87
|
+
for (let n = 0; n < t.length; n += 4) {
|
|
88
|
+
const f = e.has(t[n]) ? e.get(t[n]) : 64, a = e.has(t[n + 1]) ? e.get(t[n + 1]) : 64, i = e.has(t[n + 2]) ? e.get(t[n + 2]) : 64, s = e.has(t[n + 3]) ? e.get(t[n + 3]) : 64, u = f << 18 | a << 12 | (i & 63) << 6 | s & 63, g = u >> 16 & 255, b = u >> 8 & 255, A = u & 255;
|
|
89
|
+
c.push(g), i !== 64 && c.push(b), s !== 64 && c.push(A);
|
|
89
90
|
}
|
|
90
91
|
return c;
|
|
91
92
|
}
|
|
92
|
-
function C(
|
|
93
|
-
const o =
|
|
93
|
+
function C(r) {
|
|
94
|
+
const o = h();
|
|
94
95
|
if (typeof o.TextDecoder == "function")
|
|
95
|
-
return new o.TextDecoder("utf-8").decode(new Uint8Array(
|
|
96
|
+
return new o.TextDecoder("utf-8").decode(new Uint8Array(r));
|
|
96
97
|
let e = "";
|
|
97
|
-
for (let t = 0; t <
|
|
98
|
-
const c =
|
|
98
|
+
for (let t = 0; t < r.length; ) {
|
|
99
|
+
const c = r[t++];
|
|
99
100
|
if (c < 128)
|
|
100
101
|
e += String.fromCharCode(c);
|
|
101
102
|
else if (c < 224) {
|
|
102
|
-
const
|
|
103
|
-
e += String.fromCharCode((c & 31) << 6 |
|
|
103
|
+
const n = r[t++];
|
|
104
|
+
e += String.fromCharCode((c & 31) << 6 | n & 63);
|
|
104
105
|
} else if (c < 240) {
|
|
105
|
-
const
|
|
106
|
+
const n = r[t++], f = r[t++];
|
|
106
107
|
e += String.fromCharCode(
|
|
107
|
-
(c & 15) << 12 | (
|
|
108
|
+
(c & 15) << 12 | (n & 63) << 6 | f & 63
|
|
108
109
|
);
|
|
109
110
|
} else {
|
|
110
|
-
const
|
|
111
|
+
const n = r[t++], f = r[t++], a = r[t++], s = ((c & 7) << 18 | (n & 63) << 12 | (f & 63) << 6 | a & 63) - 65536;
|
|
111
112
|
e += String.fromCharCode(
|
|
112
113
|
55296 + (s >> 10 & 1023),
|
|
113
114
|
56320 + (s & 1023)
|
|
@@ -117,7 +118,7 @@ function C(n) {
|
|
|
117
118
|
return e;
|
|
118
119
|
}
|
|
119
120
|
export {
|
|
120
|
-
|
|
121
|
+
T as bytesToBase64,
|
|
121
122
|
y as fromBase64,
|
|
122
|
-
|
|
123
|
+
S as toBase64
|
|
123
124
|
};
|
|
@@ -12,6 +12,10 @@ export type ConvertCaseMode = (typeof CaseTypes)[keyof typeof CaseTypes];
|
|
|
12
12
|
/**
|
|
13
13
|
* Convert the case of a string.
|
|
14
14
|
*
|
|
15
|
+
* @param value - The string to convert.
|
|
16
|
+
* @param mode - The case conversion mode to apply. Defaults to 'fold'.
|
|
17
|
+
* @returns The converted string.
|
|
18
|
+
*
|
|
15
19
|
* @example
|
|
16
20
|
*
|
|
17
21
|
* convertCase('hello', CaseTypes.upper); -> 'HELLO'
|
|
@@ -20,6 +24,9 @@ export declare function convertCase(value: string, mode?: ConvertCaseMode): stri
|
|
|
20
24
|
/**
|
|
21
25
|
* Convert the given string to upper-case.
|
|
22
26
|
*
|
|
27
|
+
* @param value - The string to convert.
|
|
28
|
+
* @returns The upper-case string.
|
|
29
|
+
*
|
|
23
30
|
* @example
|
|
24
31
|
*
|
|
25
32
|
* upper("foo bar baz"); -> "FOO BAR BAZ"
|
|
@@ -29,6 +36,9 @@ export declare function upper(value: string): string;
|
|
|
29
36
|
/**
|
|
30
37
|
* Convert the given string to proper case.
|
|
31
38
|
*
|
|
39
|
+
* @param value - The string to convert.
|
|
40
|
+
* @returns The proper-case string.
|
|
41
|
+
*
|
|
32
42
|
* @example
|
|
33
43
|
*
|
|
34
44
|
* title("foo bar baz"); -> "Foo Bar Baz"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/convertcase/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;CASZ,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/convertcase/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;CASZ,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACvB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,eAAgC,GACvC,MAAM,CAER;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
package/dist/index.js
CHANGED
|
@@ -2,136 +2,137 @@ import { ascii as t } from "./ascii/index.js";
|
|
|
2
2
|
import { bytesToBase64 as s, fromBase64 as i, toBase64 as o } from "./base64/index.js";
|
|
3
3
|
import { CaseTypes as l, convertCase as c, title as p, upper as d } from "./convertcase/index.js";
|
|
4
4
|
import { inlineMarkdown as m, markDownRenderer as f, markdown as h } from "./markdown/index.js";
|
|
5
|
-
import { inflector as S, isPlural as U, isSingular as w, matchCase as x, plural as b,
|
|
6
|
-
import { randomInt as
|
|
7
|
-
import { substr as
|
|
8
|
-
import { after as
|
|
9
|
-
import { Stringable as
|
|
5
|
+
import { inflector as S, isPlural as U, isSingular as w, matchCase as x, plural as b, pluralPascal as C, pluralStudly as k, singular as y, uncountable as R } from "./pluralizer/index.js";
|
|
6
|
+
import { randomInt as A, randomString as W } from "./random/index.js";
|
|
7
|
+
import { substr as B, substrCount as L, substrReplace as v } from "./replacer/index.js";
|
|
8
|
+
import { after as M, afterLast as N, apa as P, before as T, beforeLast as F, between as D, betweenFirst as I, camel as J, camelCacheSize as O, charAt as j, chopEnd as G, chopStart as H, contains as K, containsAll as Q, createRandomStringsNormally as V, createRandomStringsUsing as X, createRandomStringsUsingSequence as Y, deduplicate as Z, doesntContain as _, doesntEndWith as $, doesntStartWith as ee, endsWith as re, excerpt as te, finish as ae, flushCache as se, headline as ie, is as oe, isAscii as ne, isJson as le, isMatch as ce, isUrl as pe, kebab as de, lcfirst as ue, length as me, limit as fe, lower as he, makePad as ge, mask as Se, match as Ue, matchAll as we, numbers as xe, padBoth as be, padLeft as Ce, padRight as ke, pascal as ye, password as Re, position as ze, random as Ae, remove as We, repeat as qe, replace as Be, replaceArray as Le, replaceEnd as ve, replaceFirst as Ee, replaceLast as Me, replaceMatches as Ne, replaceStart as Pe, reverse as Te, slug as Fe, snake as De, snakeCacheSize as Ie, squish as Je, start as Oe, startsWith as je, stripTags as Ge, studly as He, studlyCacheSize as Ke, swap as Qe, take as Ve, toStringOr as Xe, ucfirst as Ye, ucsplit as Ze, ucwords as _e, unwrap as $e, wordCount as er, wordWrap as rr, words as tr, wrap as ar } from "./str.js";
|
|
9
|
+
import { Stringable as ir, of as or, str as nr } from "./stringable/index.js";
|
|
10
10
|
import { transliterate as cr } from "./transliterate/index.js";
|
|
11
11
|
import { ltrim as dr, rtrim as ur, trim as mr } from "./trimmer/index.js";
|
|
12
|
-
import { createUlidsNormally as hr, createUlidsUsing as gr, createUlidsUsingSequence as Sr, freezeUlids as Ur,
|
|
13
|
-
import { createUuidsNormally as
|
|
12
|
+
import { createUlidsNormally as hr, createUlidsUsing as gr, createUlidsUsingSequence as Sr, freezeUlids as Ur, isUlid as wr, ulid as xr } from "./ulid/index.js";
|
|
13
|
+
import { createUuidsNormally as Cr, createUuidsUsing as kr, createUuidsUsingSequence as yr, freezeUuids as Rr, isUuid as zr, uuid as Ar, uuid7 as Wr } from "./uuid/index.js";
|
|
14
14
|
export {
|
|
15
15
|
l as CaseTypes,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
ir as Stringable,
|
|
17
|
+
M as after,
|
|
18
|
+
N as afterLast,
|
|
19
|
+
P as apa,
|
|
20
20
|
t as ascii,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
T as before,
|
|
22
|
+
F as beforeLast,
|
|
23
|
+
D as between,
|
|
24
|
+
I as betweenFirst,
|
|
25
25
|
s as bytesToBase64,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
J as camel,
|
|
27
|
+
O as camelCacheSize,
|
|
28
|
+
j as charAt,
|
|
29
|
+
G as chopEnd,
|
|
30
|
+
H as chopStart,
|
|
31
|
+
K as contains,
|
|
32
|
+
Q as containsAll,
|
|
33
33
|
c as convertCase,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
V as createRandomStringsNormally,
|
|
35
|
+
X as createRandomStringsUsing,
|
|
36
|
+
Y as createRandomStringsUsingSequence,
|
|
37
37
|
hr as createUlidsNormally,
|
|
38
38
|
gr as createUlidsUsing,
|
|
39
39
|
Sr as createUlidsUsingSequence,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
Cr as createUuidsNormally,
|
|
41
|
+
kr as createUuidsUsing,
|
|
42
|
+
yr as createUuidsUsingSequence,
|
|
43
|
+
Z as deduplicate,
|
|
44
|
+
_ as doesntContain,
|
|
45
|
+
$ as doesntEndWith,
|
|
46
|
+
ee as doesntStartWith,
|
|
47
|
+
re as endsWith,
|
|
48
|
+
te as excerpt,
|
|
49
|
+
ae as finish,
|
|
50
|
+
se as flushCache,
|
|
51
51
|
Ur as freezeUlids,
|
|
52
|
-
|
|
52
|
+
Rr as freezeUuids,
|
|
53
53
|
i as fromBase64,
|
|
54
|
-
|
|
54
|
+
ie as headline,
|
|
55
55
|
S as inflector,
|
|
56
56
|
m as inlineMarkdown,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
oe as is,
|
|
58
|
+
ne as isAscii,
|
|
59
|
+
le as isJson,
|
|
60
|
+
ce as isMatch,
|
|
61
61
|
U as isPlural,
|
|
62
62
|
w as isSingular,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
wr as isUlid,
|
|
64
|
+
pe as isUrl,
|
|
65
|
+
zr as isUuid,
|
|
66
|
+
de as kebab,
|
|
67
|
+
ue as lcfirst,
|
|
68
|
+
me as length,
|
|
69
|
+
fe as limit,
|
|
70
|
+
he as lower,
|
|
71
71
|
dr as ltrim,
|
|
72
|
-
|
|
72
|
+
ge as makePad,
|
|
73
73
|
f as markDownRenderer,
|
|
74
74
|
h as markdown,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
Se as mask,
|
|
76
|
+
Ue as match,
|
|
77
|
+
we as matchAll,
|
|
78
78
|
x as matchCase,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
xe as numbers,
|
|
80
|
+
or as of,
|
|
81
|
+
be as padBoth,
|
|
82
|
+
Ce as padLeft,
|
|
83
|
+
ke as padRight,
|
|
84
|
+
ye as pascal,
|
|
85
|
+
Re as password,
|
|
86
86
|
b as plural,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
C as pluralPascal,
|
|
88
|
+
k as pluralStudly,
|
|
89
|
+
ze as position,
|
|
90
|
+
Ae as random,
|
|
91
|
+
A as randomInt,
|
|
92
|
+
W as randomString,
|
|
93
|
+
We as remove,
|
|
94
|
+
qe as repeat,
|
|
95
|
+
Be as replace,
|
|
96
|
+
Le as replaceArray,
|
|
97
|
+
ve as replaceEnd,
|
|
98
|
+
Ee as replaceFirst,
|
|
99
|
+
Me as replaceLast,
|
|
100
|
+
Ne as replaceMatches,
|
|
101
|
+
Pe as replaceStart,
|
|
102
|
+
Te as reverse,
|
|
103
103
|
ur as rtrim,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
y as singular,
|
|
105
|
+
Fe as slug,
|
|
106
|
+
De as snake,
|
|
107
|
+
Ie as snakeCacheSize,
|
|
108
|
+
Je as squish,
|
|
109
|
+
Oe as start,
|
|
110
|
+
je as startsWith,
|
|
111
|
+
nr as str,
|
|
112
|
+
Ge as stripTags,
|
|
113
|
+
He as studly,
|
|
114
|
+
Ke as studlyCacheSize,
|
|
115
|
+
B as substr,
|
|
116
|
+
L as substrCount,
|
|
117
|
+
v as substrReplace,
|
|
118
|
+
Qe as swap,
|
|
119
|
+
Ve as take,
|
|
119
120
|
p as title,
|
|
120
121
|
o as toBase64,
|
|
121
|
-
|
|
122
|
+
Xe as toStringOr,
|
|
122
123
|
cr as transliterate,
|
|
123
124
|
mr as trim,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
Ye as ucfirst,
|
|
126
|
+
Ze as ucsplit,
|
|
127
|
+
_e as ucwords,
|
|
128
|
+
xr as ulid,
|
|
129
|
+
R as uncountable,
|
|
130
|
+
$e as unwrap,
|
|
130
131
|
d as upper,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
Ar as uuid,
|
|
133
|
+
Wr as uuid7,
|
|
134
|
+
er as wordCount,
|
|
135
|
+
rr as wordWrap,
|
|
136
|
+
tr as words,
|
|
137
|
+
ar as wrap
|
|
137
138
|
};
|
package/dist/markdown/index.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ export type MarkDownExtensions = MarkDownExtension[];
|
|
|
9
9
|
/**
|
|
10
10
|
* Converts GitHub flavored Markdown into HTML.
|
|
11
11
|
*
|
|
12
|
+
* @param value - The markdown string to convert.
|
|
13
|
+
* @param options - Options to customize the markdown rendering. Defaults to GFM enabled and no anchors.
|
|
14
|
+
* @param extensions - An array of markdown-it extensions to apply during rendering.
|
|
15
|
+
* @returns The resulting HTML string.
|
|
16
|
+
*
|
|
17
|
+
* @requires {@link https://www.npmjs.com/package/markdown-it markdown-it package}
|
|
18
|
+
*
|
|
12
19
|
* @example
|
|
13
20
|
*
|
|
14
21
|
* markdown('# Hello World'); -> '<h1>Hello World</h1>\n'
|
|
@@ -17,10 +24,26 @@ export declare function markdown(value: string, options?: MarkDownOptions, exten
|
|
|
17
24
|
/**
|
|
18
25
|
* Converts inline Markdown into HTML.
|
|
19
26
|
*
|
|
27
|
+
* @param value - The inline markdown string to convert.
|
|
28
|
+
* @param options - Options to customize the markdown rendering. Defaults to GFM enabled.
|
|
29
|
+
* @param extensions - An array of markdown-it extensions to apply during rendering.
|
|
30
|
+
* @returns The resulting HTML string.
|
|
31
|
+
*
|
|
32
|
+
* @requires {@link https://www.npmjs.com/package/markdown-it markdown-it package}
|
|
33
|
+
*
|
|
20
34
|
* @example
|
|
21
35
|
*
|
|
22
36
|
* inlineMarkdown("Hello *World*"); -> "<p>Hello <em>World</em></p>"
|
|
23
37
|
*/
|
|
24
38
|
export declare function inlineMarkdown(value: string, options?: MarkDownOptions, extensions?: MarkDownExtensions): string;
|
|
39
|
+
/**
|
|
40
|
+
* Creates and configures a MarkdownIt renderer with the specified options and extensions.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Options to customize the markdown rendering. Defaults to GFM enabled and no anchors.
|
|
43
|
+
* @param extensions - An array of markdown-it extensions to apply during rendering.
|
|
44
|
+
* @returns A configured MarkdownIt instance.
|
|
45
|
+
*
|
|
46
|
+
* @requires {@link https://www.npmjs.com/package/markdown-it markdown-it package}
|
|
47
|
+
*/
|
|
25
48
|
export declare function markDownRenderer(options?: MarkDownOptions, extensions?: MarkDownExtensions): MarkdownIt;
|
|
26
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;CACzB;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
|
|
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;CACzB;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;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAA+C,EACxD,UAAU,GAAE,kBAAuB,GACpC,MAAM,CAER;AAED;;;;;;;;;;;;;GAaG;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,cAgCtC"}
|
|
@@ -2,9 +2,44 @@ import { default as pluralize } from 'pluralize';
|
|
|
2
2
|
export interface PluralizerRules {
|
|
3
3
|
uncountable: string[];
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Pluralize the last word of an English, studly caps case string.
|
|
7
|
+
*
|
|
8
|
+
* @param value - The studly caps case string to pluralize
|
|
9
|
+
* @param count - The count to determine pluralization (default: 2)
|
|
10
|
+
* @returns The pluralized studly caps case string
|
|
11
|
+
*
|
|
12
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* pluralStudly("These are the school", 4); -> "These are the schools"
|
|
17
|
+
*/
|
|
18
|
+
export declare function pluralStudly(value: string, count?: number): string;
|
|
19
|
+
/**
|
|
20
|
+
* Pluralize the last word of an English, Pascal caps case string.
|
|
21
|
+
*
|
|
22
|
+
* @param value - The Pascal caps case string to pluralize
|
|
23
|
+
* @param count - The count to determine pluralization (default: 2)
|
|
24
|
+
* @returns The pluralized Pascal caps case string
|
|
25
|
+
*
|
|
26
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* pluralPascal("These are the school", 4); -> "These are the schools"
|
|
31
|
+
*/
|
|
32
|
+
export declare function pluralPascal(value: string, count?: number): string;
|
|
5
33
|
/**
|
|
6
34
|
* Get the plural form of an English word.
|
|
7
35
|
*
|
|
36
|
+
* @param value - The word to pluralize.
|
|
37
|
+
* @param count - The count to determine pluralization (default: 2)
|
|
38
|
+
* @param prependCount - Whether to prepend the count to the result (default: false)
|
|
39
|
+
* @returns The pluralized word, optionally with the count prepended.
|
|
40
|
+
*
|
|
41
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
42
|
+
*
|
|
8
43
|
* @example
|
|
9
44
|
*
|
|
10
45
|
* plural("child"); -> "children"
|
|
@@ -14,26 +49,52 @@ export interface PluralizerRules {
|
|
|
14
49
|
export declare function plural(value: string, count?: number, prependCount?: boolean): string;
|
|
15
50
|
/**
|
|
16
51
|
* Get the singular form of an English word.
|
|
52
|
+
*
|
|
53
|
+
* @param value - The word to singularize.
|
|
54
|
+
* @returns The singular form of the word.
|
|
55
|
+
*
|
|
56
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
17
57
|
*/
|
|
18
58
|
export declare function singular(value: string): string;
|
|
19
59
|
/**
|
|
20
60
|
* Determine if the given value is uncountable.
|
|
61
|
+
*
|
|
62
|
+
* @param value - The word to check.
|
|
63
|
+
* @returns True if the word is uncountable, false otherwise.
|
|
64
|
+
*
|
|
65
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
21
66
|
*/
|
|
22
67
|
export declare function uncountable(value: string): boolean;
|
|
23
68
|
/**
|
|
24
69
|
* Determine if the given value is plural.
|
|
70
|
+
*
|
|
71
|
+
* @param value - The word to check.
|
|
72
|
+
* @returns True if the word is plural, false otherwise.
|
|
73
|
+
*
|
|
74
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
25
75
|
*/
|
|
26
76
|
export declare function isPlural(value?: string): boolean;
|
|
27
77
|
/**
|
|
28
78
|
* Determine if the given value is singular.
|
|
79
|
+
*
|
|
80
|
+
* @param value - The word to check.
|
|
81
|
+
* @returns True if the word is singular, false otherwise.
|
|
82
|
+
*
|
|
83
|
+
* @requires {@link https://www.npmjs.com/package/pluralize pluralize package}
|
|
29
84
|
*/
|
|
30
85
|
export declare function isSingular(value?: string): boolean;
|
|
31
86
|
/**
|
|
32
87
|
* Attempt to match the case on two strings
|
|
88
|
+
*
|
|
89
|
+
* @param value - The string to adjust.
|
|
90
|
+
* @param comparison - The string to match the case against.
|
|
91
|
+
* @returns The adjusted string with matched case.
|
|
33
92
|
*/
|
|
34
93
|
export declare function matchCase(value: string, comparison: string): string;
|
|
35
94
|
/**
|
|
36
95
|
* Get the pluralize instance
|
|
96
|
+
*
|
|
97
|
+
* @returns The pluralize instance.
|
|
37
98
|
*/
|
|
38
99
|
export declare function inflector(): typeof pluralize;
|
|
39
100
|
//# sourceMappingURL=index.d.ts.map
|