@zinaid/str 0.0.5 → 0.0.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/dist/ascii/index.d.ts +9 -0
- package/dist/ascii/index.d.ts.map +1 -0
- package/dist/ascii/index.js +7 -0
- package/dist/{base64.d.ts → base64/index.d.ts} +1 -1
- package/dist/base64/index.d.ts.map +1 -0
- package/dist/{convertcase.d.ts → convertcase/index.d.ts} +1 -1
- package/dist/convertcase/index.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -131
- package/dist/{markdown.d.ts → markdown/index.d.ts} +3 -3
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +32 -0
- package/dist/{pluralizer.d.ts → pluralizer/index.d.ts} +3 -2
- package/dist/pluralizer/index.d.ts.map +1 -0
- package/dist/{pluralizer.js → pluralizer/index.js} +13 -15
- package/dist/{random.d.ts → random/index.d.ts} +3 -3
- package/dist/random/index.d.ts.map +1 -0
- package/dist/{random.js → random/index.js} +2 -1
- package/dist/{replacer.d.ts → replacer/index.d.ts} +1 -1
- package/dist/replacer/index.d.ts.map +1 -0
- package/dist/str.d.ts +8 -113
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +521 -656
- package/dist/{stringable.d.ts → stringable/index.d.ts} +2 -2
- package/dist/stringable/index.d.ts.map +1 -0
- package/dist/transliterate/index.d.ts +9 -0
- package/dist/transliterate/index.d.ts.map +1 -0
- package/dist/transliterate/index.js +7 -0
- package/dist/{trimmer.d.ts → trimmer/index.d.ts} +1 -1
- package/dist/trimmer/index.d.ts.map +1 -0
- package/dist/ulid/index.d.ts +41 -0
- package/dist/ulid/index.d.ts.map +1 -0
- package/dist/ulid/index.js +50 -0
- package/dist/uuid/index.d.ts +58 -0
- package/dist/uuid/index.d.ts.map +1 -0
- package/dist/uuid/index.js +50 -0
- package/package.json +78 -21
- package/dist/base64.d.ts.map +0 -1
- package/dist/convertcase.d.ts.map +0 -1
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js +0 -55
- package/dist/pluralizer.d.ts.map +0 -1
- package/dist/random.d.ts.map +0 -1
- package/dist/replacer.d.ts.map +0 -1
- package/dist/stringable.d.ts.map +0 -1
- package/dist/trimmer.d.ts.map +0 -1
- /package/dist/{base64.js → base64/index.js} +0 -0
- /package/dist/{convertcase.js → convertcase/index.js} +0 -0
- /package/dist/{replacer.js → replacer/index.js} +0 -0
- /package/dist/{stringable.js → stringable/index.js} +0 -0
- /package/dist/{trimmer.js → trimmer/index.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ascii/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
|
@@ -4,4 +4,4 @@ export declare function toBase64(value: string): string;
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
6
6
|
export declare function fromBase64(value: string, strict?: boolean): string | false;
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base64/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA+B9C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAsBvD;AAED,wBAAgB,UAAU,CACtB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,OAAe,GACxB,MAAM,GAAG,KAAK,CAqEhB"}
|
|
@@ -0,0 +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;;;;;;GAMG;AACH,wBAAgB,WAAW,CACvB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,eAAgC,GACvC,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './ascii';
|
|
1
2
|
export * from './base64';
|
|
2
3
|
export * from './convertcase';
|
|
3
4
|
export * from './markdown';
|
|
@@ -6,5 +7,8 @@ export * from './random';
|
|
|
6
7
|
export * from './replacer';
|
|
7
8
|
export * from './str';
|
|
8
9
|
export * from './stringable';
|
|
10
|
+
export * from './transliterate';
|
|
9
11
|
export * from './trimmer';
|
|
12
|
+
export * from './ulid';
|
|
13
|
+
export * from './uuid';
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,133 +1,137 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { ascii as t } from "./ascii/index.js";
|
|
2
|
+
import { bytesToBase64 as s, fromBase64 as i, toBase64 as o } from "./base64/index.js";
|
|
3
|
+
import { CaseTypes as l, convertCase as c, title as p, upper as d } from "./convertcase/index.js";
|
|
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, singular as C, uncountable as k } from "./pluralizer/index.js";
|
|
6
|
+
import { randomInt as R, randomString as z } from "./random/index.js";
|
|
7
|
+
import { substr as W, substrCount as q, substrReplace as B } from "./replacer/index.js";
|
|
8
|
+
import { after as v, afterLast as E, apa as M, before as N, beforeLast as P, between as T, betweenFirst as F, camel as D, camelCacheSize as I, charAt as J, chopEnd as O, chopStart as j, contains as G, containsAll as H, createRandomStringsNormally as K, createRandomStringsUsing as Q, createRandomStringsUsingSequence as V, deduplicate as X, doesntContain as Y, doesntEndWith as Z, doesntStartWith as _, endsWith as $, excerpt as ee, finish as re, flushCache as te, headline as ae, is as se, isAscii as ie, isJson as oe, isMatch as ne, isUlid as le, isUrl as ce, kebab as pe, lcfirst as de, length as ue, limit as me, lower as fe, makePad as he, mask as ge, match as Se, matchAll as Ue, numbers as we, padBoth as xe, padLeft as be, padRight as Ce, pascal as ke, password as ye, pluralPascal as Re, pluralStudly as ze, position as Ae, random as We, remove as qe, repeat as Be, replace as Le, replaceArray as ve, replaceEnd as Ee, replaceFirst as Me, replaceLast as Ne, replaceMatches as Pe, replaceStart as Te, reverse as Fe, slug as De, snake as Ie, snakeCacheSize as Je, squish as Oe, start as je, startsWith as Ge, stripTags as He, studly as Ke, studlyCacheSize as Qe, swap as Ve, take as Xe, toStringOr as Ye, ucfirst as Ze, ucsplit as _e, ucwords as $e, unwrap as er, wordCount as rr, wordWrap as tr, words as ar, wrap as sr } from "./str.js";
|
|
9
|
+
import { Stringable as or, of as nr } from "./stringable/index.js";
|
|
10
|
+
import { transliterate as cr } from "./transliterate/index.js";
|
|
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, ulid as wr } from "./ulid/index.js";
|
|
13
|
+
import { createUuidsNormally as br, createUuidsUsing as Cr, createUuidsUsingSequence as kr, freezeUuids as yr, isUuid as Rr, uuid as zr, uuid7 as Ar } from "./uuid/index.js";
|
|
10
14
|
export {
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
15
|
+
l as CaseTypes,
|
|
16
|
+
or as Stringable,
|
|
17
|
+
v as after,
|
|
18
|
+
E as afterLast,
|
|
19
|
+
M as apa,
|
|
20
|
+
t as ascii,
|
|
21
|
+
N as before,
|
|
22
|
+
P as beforeLast,
|
|
23
|
+
T as between,
|
|
24
|
+
F as betweenFirst,
|
|
25
|
+
s as bytesToBase64,
|
|
26
|
+
D as camel,
|
|
27
|
+
I as camelCacheSize,
|
|
28
|
+
J as charAt,
|
|
29
|
+
O as chopEnd,
|
|
30
|
+
j as chopStart,
|
|
31
|
+
G as contains,
|
|
32
|
+
H as containsAll,
|
|
33
|
+
c as convertCase,
|
|
34
|
+
K as createRandomStringsNormally,
|
|
35
|
+
Q as createRandomStringsUsing,
|
|
36
|
+
V as createRandomStringsUsingSequence,
|
|
37
|
+
hr as createUlidsNormally,
|
|
38
|
+
gr as createUlidsUsing,
|
|
39
|
+
Sr as createUlidsUsingSequence,
|
|
40
|
+
br as createUuidsNormally,
|
|
41
|
+
Cr as createUuidsUsing,
|
|
42
|
+
kr as createUuidsUsingSequence,
|
|
43
|
+
X as deduplicate,
|
|
44
|
+
Y as doesntContain,
|
|
45
|
+
Z as doesntEndWith,
|
|
46
|
+
_ as doesntStartWith,
|
|
47
|
+
$ as endsWith,
|
|
48
|
+
ee as excerpt,
|
|
49
|
+
re as finish,
|
|
50
|
+
te as flushCache,
|
|
51
|
+
Ur as freezeUlids,
|
|
52
|
+
yr as freezeUuids,
|
|
53
|
+
i as fromBase64,
|
|
54
|
+
ae as headline,
|
|
55
|
+
S as inflector,
|
|
56
|
+
m as inlineMarkdown,
|
|
57
|
+
se as is,
|
|
58
|
+
ie as isAscii,
|
|
59
|
+
oe as isJson,
|
|
60
|
+
ne as isMatch,
|
|
61
|
+
U as isPlural,
|
|
62
|
+
w as isSingular,
|
|
63
|
+
le as isUlid,
|
|
64
|
+
ce as isUrl,
|
|
65
|
+
Rr as isUuid,
|
|
66
|
+
pe as kebab,
|
|
67
|
+
de as lcfirst,
|
|
68
|
+
ue as length,
|
|
69
|
+
me as limit,
|
|
70
|
+
fe as lower,
|
|
71
|
+
dr as ltrim,
|
|
72
|
+
he as makePad,
|
|
73
|
+
f as markDownRenderer,
|
|
74
|
+
h as markdown,
|
|
75
|
+
ge as mask,
|
|
76
|
+
Se as match,
|
|
77
|
+
Ue as matchAll,
|
|
78
|
+
x as matchCase,
|
|
79
|
+
we as numbers,
|
|
80
|
+
nr as of,
|
|
81
|
+
xe as padBoth,
|
|
82
|
+
be as padLeft,
|
|
83
|
+
Ce as padRight,
|
|
84
|
+
ke as pascal,
|
|
85
|
+
ye as password,
|
|
86
|
+
b as plural,
|
|
87
|
+
Re as pluralPascal,
|
|
88
|
+
ze as pluralStudly,
|
|
89
|
+
Ae as position,
|
|
90
|
+
We as random,
|
|
91
|
+
R as randomInt,
|
|
92
|
+
z as randomString,
|
|
93
|
+
qe as remove,
|
|
94
|
+
Be as repeat,
|
|
95
|
+
Le as replace,
|
|
96
|
+
ve as replaceArray,
|
|
97
|
+
Ee as replaceEnd,
|
|
98
|
+
Me as replaceFirst,
|
|
99
|
+
Ne as replaceLast,
|
|
100
|
+
Pe as replaceMatches,
|
|
101
|
+
Te as replaceStart,
|
|
102
|
+
Fe as reverse,
|
|
103
|
+
ur as rtrim,
|
|
104
|
+
C as singular,
|
|
105
|
+
De as slug,
|
|
106
|
+
Ie as snake,
|
|
107
|
+
Je as snakeCacheSize,
|
|
108
|
+
Oe as squish,
|
|
109
|
+
je as start,
|
|
110
|
+
Ge as startsWith,
|
|
111
|
+
He as stripTags,
|
|
112
|
+
Ke as studly,
|
|
113
|
+
Qe as studlyCacheSize,
|
|
114
|
+
W as substr,
|
|
115
|
+
q as substrCount,
|
|
116
|
+
B as substrReplace,
|
|
117
|
+
Ve as swap,
|
|
118
|
+
Xe as take,
|
|
119
|
+
p as title,
|
|
120
|
+
o as toBase64,
|
|
121
|
+
Ye as toStringOr,
|
|
122
|
+
cr as transliterate,
|
|
123
|
+
mr as trim,
|
|
124
|
+
Ze as ucfirst,
|
|
125
|
+
_e as ucsplit,
|
|
126
|
+
$e as ucwords,
|
|
127
|
+
wr as ulid,
|
|
128
|
+
k as uncountable,
|
|
129
|
+
er as unwrap,
|
|
130
|
+
d as upper,
|
|
131
|
+
zr as uuid,
|
|
132
|
+
Ar as uuid7,
|
|
133
|
+
rr as wordCount,
|
|
134
|
+
tr as wordWrap,
|
|
135
|
+
ar as words,
|
|
136
|
+
sr as wrap
|
|
133
137
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Options as MarkdownItOptions, PluginSimple, PluginWithOptions
|
|
1
|
+
import { default as MarkdownIt, Options as MarkdownItOptions, PluginSimple, PluginWithOptions } from 'markdown-it';
|
|
2
2
|
export interface MarkDownOptions extends MarkdownItOptions {
|
|
3
3
|
gfm?: boolean;
|
|
4
4
|
anchors?: object | boolean;
|
|
@@ -22,5 +22,5 @@ export declare function markdown(value: string, options?: MarkDownOptions, exten
|
|
|
22
22
|
* inlineMarkdown("Hello *World*"); -> "<p>Hello <em>World</em></p>"
|
|
23
23
|
*/
|
|
24
24
|
export declare function inlineMarkdown(value: string, options?: MarkDownOptions, extensions?: MarkDownExtensions): string;
|
|
25
|
-
export declare function markDownRenderer(options?: MarkDownOptions, extensions?: MarkDownExtensions):
|
|
26
|
-
//# sourceMappingURL=
|
|
25
|
+
export declare function markDownRenderer(options?: MarkDownOptions, extensions?: MarkDownExtensions): MarkdownIt;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAA+C,EACxD,UAAU,GAAE,kBAAuB,GACpC,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,eAA+B,EACxC,UAAU,GAAE,kBAAuB,GACpC,MAAM,CAER;AAED,wBAAgB,gBAAgB,CAC5B,OAAO,GAAE,eAA+C,EACxD,UAAU,GAAE,kBAAuB,cAgCtC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isArray as d } from "@zinaid/utils";
|
|
2
|
+
import k from "markdown-it";
|
|
3
|
+
import p from "markdown-it-anchor";
|
|
4
|
+
import w from "markdown-it-task-lists";
|
|
5
|
+
function y(r, e = { gfm: !0, anchors: !1 }, t = []) {
|
|
6
|
+
return s(e, t).render(r);
|
|
7
|
+
}
|
|
8
|
+
function A(r, e = { gfm: !0 }, t = []) {
|
|
9
|
+
return s(e, t).renderInline(r);
|
|
10
|
+
}
|
|
11
|
+
function s(r = { gfm: !0, anchors: !1 }, e = []) {
|
|
12
|
+
const {
|
|
13
|
+
html: t = !1,
|
|
14
|
+
linkify: i = !0,
|
|
15
|
+
breaks: u = !0,
|
|
16
|
+
gfm: a = !0,
|
|
17
|
+
anchors: f = !1,
|
|
18
|
+
...m
|
|
19
|
+
} = r, n = new k({ html: t, linkify: i, breaks: u, ...m });
|
|
20
|
+
a && n.use(w, { label: !0, labelAfter: !0 }), f && n.use(p, typeof f == "object" ? f : {});
|
|
21
|
+
for (const o of e)
|
|
22
|
+
if (d(o)) {
|
|
23
|
+
const [l, c] = o;
|
|
24
|
+
n.use(l, c);
|
|
25
|
+
} else o && n.use(o);
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
A as inlineMarkdown,
|
|
30
|
+
s as markDownRenderer,
|
|
31
|
+
y as markdown
|
|
32
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as pluralize } from 'pluralize';
|
|
1
2
|
export interface PluralizerRules {
|
|
2
3
|
uncountable: string[];
|
|
3
4
|
}
|
|
@@ -34,5 +35,5 @@ export declare function matchCase(value: string, comparison: string): string;
|
|
|
34
35
|
/**
|
|
35
36
|
* Get the pluralize instance
|
|
36
37
|
*/
|
|
37
|
-
export declare function inflector(): typeof
|
|
38
|
-
//# sourceMappingURL=
|
|
38
|
+
export declare function inflector(): typeof pluralize;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pluralizer/index.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAoDD;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAClB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAAU,EACjB,YAAY,GAAE,OAAe,GAC9B,MAAM,CAKR;AAeD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiBnE;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,SAAS,CAU5C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { format as
|
|
2
|
-
import { isUndefined as
|
|
1
|
+
import { format as a } from "@zinaid/num";
|
|
2
|
+
import { isUndefined as s } from "@zinaid/utils";
|
|
3
|
+
import l from "pluralize";
|
|
3
4
|
let r;
|
|
4
5
|
const o = {
|
|
5
6
|
uncountable: [
|
|
@@ -48,18 +49,18 @@ const o = {
|
|
|
48
49
|
"wheat"
|
|
49
50
|
]
|
|
50
51
|
};
|
|
51
|
-
function
|
|
52
|
-
return (i ?
|
|
52
|
+
function w(e, n = 2, i = !1) {
|
|
53
|
+
return (i ? a(n) + " " : "") + f(e, n);
|
|
53
54
|
}
|
|
54
55
|
function f(e, n) {
|
|
55
56
|
if (Math.abs(n) === 1 || c(e))
|
|
56
57
|
return e;
|
|
57
58
|
const i = t().plural(e);
|
|
58
|
-
return
|
|
59
|
+
return u(i, e);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function b(e) {
|
|
61
62
|
const n = t().singular(e);
|
|
62
|
-
return
|
|
63
|
+
return u(n, e);
|
|
63
64
|
}
|
|
64
65
|
function c(e) {
|
|
65
66
|
return o.uncountable.includes(e.toLowerCase());
|
|
@@ -70,14 +71,11 @@ function g(e = "") {
|
|
|
70
71
|
function h(e = "") {
|
|
71
72
|
return t().isSingular(e);
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function u(e, n) {
|
|
74
75
|
return n.toLowerCase() === n ? e.toLowerCase() : n.toUpperCase() === n ? e.toUpperCase() : n[0] && n[0].toUpperCase() + n.slice(1) === n ? (e[0] ?? "").toUpperCase() + e.slice(1) : e;
|
|
75
76
|
}
|
|
76
77
|
function t() {
|
|
77
|
-
return
|
|
78
|
-
"pluralize",
|
|
79
|
-
'The "pluralize" package is required for pluralization functions. Please install it: npm install pluralize'
|
|
80
|
-
), o.uncountable.forEach(
|
|
78
|
+
return s(r) && (r = l, o.uncountable.forEach(
|
|
81
79
|
(e) => r.addUncountableRule(e)
|
|
82
80
|
)), r;
|
|
83
81
|
}
|
|
@@ -85,8 +83,8 @@ export {
|
|
|
85
83
|
t as inflector,
|
|
86
84
|
g as isPlural,
|
|
87
85
|
h as isSingular,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
u as matchCase,
|
|
87
|
+
w as plural,
|
|
88
|
+
b as singular,
|
|
91
89
|
c as uncountable
|
|
92
90
|
};
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* @returns A random alpha-numeric string of the specified length.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* randomString(); // 16 chars
|
|
14
|
+
* randomString(40); // 40 chars
|
|
15
15
|
*/
|
|
16
16
|
export declare function randomString(length?: number): string;
|
|
17
17
|
/**
|
|
@@ -25,4 +25,4 @@ export declare function randomString(length?: number): string;
|
|
|
25
25
|
* @throws RangeError if min > max or bounds exceed MAX_SAFE_INTEGER.
|
|
26
26
|
*/
|
|
27
27
|
export declare function randomInt(min: number, max: number): number;
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/random/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAK,GAAG,MAAM,CAehD;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA4C1D"}
|
|
@@ -33,7 +33,8 @@ function l(e, t) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
function u(e) {
|
|
36
|
-
if (e <= 0)
|
|
36
|
+
if (e <= 0)
|
|
37
|
+
return new Uint8Array();
|
|
37
38
|
if (typeof globalThis.crypto?.getRandomValues == "function")
|
|
38
39
|
return globalThis.crypto.getRandomValues(new Uint8Array(e));
|
|
39
40
|
throw new Error("Secure randomness not available in this environment");
|
|
@@ -28,4 +28,4 @@ export declare function substrCount(haystack: string, needle: string, offset?: n
|
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
30
|
export declare function substrReplace(value: string, replace: string | string[], offset?: number | number[], length?: number | number[] | null): string | string[];
|
|
31
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/replacer/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CAWR;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAU,EAClB,MAAM,GAAE,MAAM,GAAG,IAAW,GAC7B,MAAM,CAgBR;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,MAAM,GAAE,MAAM,GAAG,MAAM,EAAM,EAC7B,MAAM,GAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAW,GACxC,MAAM,GAAG,MAAM,EAAE,CAyBnB"}
|