@tolki/str 1.0.14 → 1.2.0

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.
@@ -3,17 +3,17 @@ import { ascii as c, slug as p } from "../ascii/index.js";
3
3
  import { toBase64 as d, fromBase64 as f } from "../base64/index.js";
4
4
  import { convertCase as m, upper as _, title as E } from "../convertcase/index.js";
5
5
  import { markdown as y, inlineMarkdown as A } from "../markdown/index.js";
6
- import { plural as W, pluralStudly as x, pluralPascal as k, singular as N } from "../pluralizer/index.js";
7
- import { substr as U, substrCount as C, substrReplace as L } from "../replacer/index.js";
8
- import { after as M, afterLast as F, before as I, beforeLast as B, between as R, betweenFirst as j, camel as D, charAt as T, chopStart as P, chopEnd as q, contains as J, containsAll as V, doesntContain as $, deduplicate as z, endsWith as G, doesntEndWith as X, excerpt as H, finish as K, is as O, isAscii as Q, isJson as Y, isUrl as Z, kebab as g, length as b, limit as S, lower as a, mask as ee, match as te, isMatch as se, matchAll as re, numbers as ne, padBoth as ue, padLeft as ie, padRight as he, position as le, remove as ae, reverse as oe, repeat as we, replace as ve, replaceArray as ce, replaceFirst as pe, replaceStart as de, replaceLast as fe, replaceEnd as me, replaceMatches as _e, squish as Ee, start as ye, stripTags as Ae, headline as We, initials as xe, apa as ke, snake as Ne, startsWith as Ue, doesntStartWith as Ce, studly as Le, pascal as Me, swap as Fe, take as Ie, lcfirst as Be, ucfirst as Re, ucsplit as je, ucwords as De, words as Te, wordCount as Pe, wordWrap as qe, wrap as Je, unwrap as Ve } from "../str.js";
9
- import { transliterate as $e } from "../transliterate/index.js";
10
- import { trim as o, ltrim as ze, rtrim as Ge } from "../trimmer/index.js";
11
- import { isUlid as Xe } from "../ulid/index.js";
12
- import { isUuid as He } from "../uuid/index.js";
13
- function nt(h = "") {
6
+ import { counted as W, plural as x, pluralStudly as k, pluralPascal as N, singular as U } from "../pluralizer/index.js";
7
+ import { substr as C, substrCount as L, substrReplace as M } from "../replacer/index.js";
8
+ import { after as F, afterLast as I, before as B, beforeLast as R, between as j, betweenFirst as D, camel as T, charAt as P, chopStart as q, chopEnd as J, contains as V, containsAll as $, doesntContain as z, deduplicate as G, endsWith as X, doesntEndWith as H, excerpt as K, finish as O, is as Q, isAscii as Y, isJson as Z, isUrl as g, kebab as b, length as S, limit as ee, lower as a, mask as te, match as se, isMatch as re, matchAll as ne, numbers as ue, padBoth as ie, padLeft as he, padRight as le, position as ae, remove as oe, reverse as we, repeat as ve, replace as ce, replaceArray as pe, replaceFirst as de, replaceStart as fe, replaceLast as me, replaceEnd as _e, replaceMatches as Ee, squish as ye, start as Ae, stripTags as We, headline as xe, initials as ke, apa as Ne, snake as Ue, startsWith as Ce, doesntStartWith as Le, studly as Me, pascal as Fe, swap as Ie, take as Be, lcfirst as Re, ucfirst as je, ucsplit as De, ucwords as Te, words as Pe, wordCount as qe, wordWrap as Je, wrap as Ve, unwrap as $e } from "../str.js";
9
+ import { transliterate as ze } from "../transliterate/index.js";
10
+ import { trim as o, ltrim as Ge, rtrim as Xe } from "../trimmer/index.js";
11
+ import { isUlid as He } from "../ulid/index.js";
12
+ import { isUuid as Ke } from "../uuid/index.js";
13
+ function ut(h = "") {
14
14
  return new s(h);
15
15
  }
16
- function ut(h = "") {
16
+ function it(h = "") {
17
17
  return new s(h);
18
18
  }
19
19
  class s {
@@ -33,7 +33,7 @@ class s {
33
33
  * @returns The portion of the string after the first occurrence of the search value.
34
34
  */
35
35
  after(e) {
36
- return new s(M(this._value, e));
36
+ return new s(F(this._value, e));
37
37
  }
38
38
  /**
39
39
  * Return the remainder of a string after the last occurrence of a given value
@@ -42,7 +42,7 @@ class s {
42
42
  * @returns The portion of the string after the last occurrence of the search value.
43
43
  */
44
44
  afterLast(e) {
45
- return new s(F(this._value, e));
45
+ return new s(I(this._value, e));
46
46
  }
47
47
  /**
48
48
  * Append the given values to the string.
@@ -78,7 +78,7 @@ class s {
78
78
  * @returns The portion of the string before the first occurrence of the search value.
79
79
  */
80
80
  before(e) {
81
- return new s(I(this._value, e));
81
+ return new s(B(this._value, e));
82
82
  }
83
83
  /**
84
84
  * Get the portion of a string before the last occurrence of a given value.
@@ -87,7 +87,7 @@ class s {
87
87
  * @returns The portion of the string before the last occurrence of the search value.
88
88
  */
89
89
  beforeLast(e) {
90
- return new s(B(this._value, e));
90
+ return new s(R(this._value, e));
91
91
  }
92
92
  /**
93
93
  * Get the portion of a string between two given values.
@@ -97,7 +97,7 @@ class s {
97
97
  * @returns The portion of the string between the two given values.
98
98
  */
99
99
  between(e, t) {
100
- return new s(R(this._value, e, t));
100
+ return new s(j(this._value, e, t));
101
101
  }
102
102
  /**
103
103
  * Get the smallest possible portion of a string between two given values.
@@ -107,7 +107,7 @@ class s {
107
107
  * @returns The smallest possible portion of the string between the two given values.
108
108
  */
109
109
  betweenFirst(e, t) {
110
- return new s(j(this._value, e, t));
110
+ return new s(D(this._value, e, t));
111
111
  }
112
112
  /**
113
113
  * Convert a value to camel case.
@@ -115,7 +115,7 @@ class s {
115
115
  * @returns The camel-cased string as a new Stringable instance.
116
116
  */
117
117
  camel() {
118
- return new s(D(this._value));
118
+ return new s(T(this._value));
119
119
  }
120
120
  /**
121
121
  * Get the character at the specified index.
@@ -124,7 +124,7 @@ class s {
124
124
  * @returns The character at the specified index, or false if the index is out of bounds.
125
125
  */
126
126
  charAt(e) {
127
- return T(this._value, e);
127
+ return P(this._value, e);
128
128
  }
129
129
  /**
130
130
  * Remove the given string if it exists at the start of the current string.
@@ -133,7 +133,7 @@ class s {
133
133
  * @returns The updated Stringable instance.
134
134
  */
135
135
  chopStart(e) {
136
- return new s(P(this._value, e));
136
+ return new s(q(this._value, e));
137
137
  }
138
138
  /**
139
139
  * Remove the given string if it exists at the end of the current string.
@@ -142,7 +142,7 @@ class s {
142
142
  * @returns The updated Stringable instance.
143
143
  */
144
144
  chopEnd(e) {
145
- return new s(q(this._value, e));
145
+ return new s(J(this._value, e));
146
146
  }
147
147
  /**
148
148
  * Determine if a given string contains a given substring.
@@ -152,7 +152,7 @@ class s {
152
152
  * @returns boolean - True if the substring(s) are found, false otherwise
153
153
  */
154
154
  contains(e, t = !1) {
155
- return J(this._value, e, t);
155
+ return V(this._value, e, t);
156
156
  }
157
157
  /**
158
158
  * Determine if a given string contains all array values.
@@ -162,7 +162,7 @@ class s {
162
162
  * @returns boolean - True if all substring(s) are found, false otherwise
163
163
  */
164
164
  containsAll(e, t = !1) {
165
- return V(this._value, e, t);
165
+ return $(this._value, e, t);
166
166
  }
167
167
  /**
168
168
  * Determine if a given string doesn't contain a given substring.
@@ -172,7 +172,7 @@ class s {
172
172
  * @returns boolean - True if the substring(s) are not found, false otherwise
173
173
  */
174
174
  doesntContain(e, t = !1) {
175
- return $(this._value, e, t);
175
+ return z(this._value, e, t);
176
176
  }
177
177
  /**
178
178
  * Convert the case of a string.
@@ -183,6 +183,15 @@ class s {
183
183
  convertCase(e) {
184
184
  return new s(m(this._value, e));
185
185
  }
186
+ /**
187
+ * Get the plural form of an English word with the count prepended.
188
+ *
189
+ * @param count - The count to determine pluralization. Arrays are counted by length.
190
+ * @returns The pluralized string with the formatted count prepended, as a new Stringable instance.
191
+ */
192
+ counted(e) {
193
+ return new s(W(this._value, e));
194
+ }
186
195
  /**
187
196
  * Replace consecutive instances of a given character with a single character.
188
197
  *
@@ -190,7 +199,7 @@ class s {
190
199
  * @returns The updated Stringable instance.
191
200
  */
192
201
  deduplicate(e = " ") {
193
- return new s(z(this._value, e));
202
+ return new s(G(this._value, e));
194
203
  }
195
204
  /**
196
205
  * Determine if a given string ends with a given substring.
@@ -199,7 +208,7 @@ class s {
199
208
  * @returns boolean - True if the substring(s) are found, false otherwise
200
209
  */
201
210
  endsWith(e) {
202
- return G(this._value, e);
211
+ return X(this._value, e);
203
212
  }
204
213
  /**
205
214
  * Determine if a given string doesn't end with a given substring.
@@ -208,7 +217,7 @@ class s {
208
217
  * @returns boolean - True if the substring(s) are not found, false otherwise
209
218
  */
210
219
  doesntEndWith(e) {
211
- return X(this._value, e);
220
+ return H(this._value, e);
212
221
  }
213
222
  /**
214
223
  * Determine if the string is an exact match with the given value.
@@ -228,7 +237,7 @@ class s {
228
237
  * @returns The extracted excerpt or null if the phrase is not found.
229
238
  */
230
239
  excerpt(e = "", t = {}) {
231
- return H(this._value, e, t);
240
+ return K(this._value, e, t);
232
241
  }
233
242
  /**
234
243
  * Explode the string into an array
@@ -272,7 +281,7 @@ class s {
272
281
  * @returns The updated Stringable instance.
273
282
  */
274
283
  finish(e) {
275
- return new s(K(this._value, e));
284
+ return new s(O(this._value, e));
276
285
  }
277
286
  /**
278
287
  * Determine if a given string matches a given pattern.
@@ -281,7 +290,7 @@ class s {
281
290
  * @returns boolean - True if the pattern(s) match, false otherwise
282
291
  */
283
292
  is(e, t = !1) {
284
- return O(e, this._value, t);
293
+ return Q(e, this._value, t);
285
294
  }
286
295
  /**
287
296
  * Determine if a given string is 7 bit ASCII.
@@ -289,7 +298,7 @@ class s {
289
298
  * @returns True if the string is ASCII, false otherwise.
290
299
  */
291
300
  isAscii() {
292
- return Q(this._value);
301
+ return Y(this._value);
293
302
  }
294
303
  /**
295
304
  * Determine if a given string is valid JSON.
@@ -297,7 +306,7 @@ class s {
297
306
  * @returns True if the string is valid JSON, false otherwise.
298
307
  */
299
308
  isJson() {
300
- return Y(this._value);
309
+ return Z(this._value);
301
310
  }
302
311
  /**
303
312
  * Determine if a given value is a valid URL.
@@ -306,7 +315,7 @@ class s {
306
315
  * @returns True if the string is a valid URL, false otherwise.
307
316
  */
308
317
  isUrl(e = []) {
309
- return Z(this._value, e);
318
+ return g(this._value, e);
310
319
  }
311
320
  /**
312
321
  * Determine if a given string is a valid UUID.
@@ -315,7 +324,7 @@ class s {
315
324
  * @returns True if the string is a valid UUID, false otherwise.
316
325
  */
317
326
  isUuid(e = null) {
318
- return He(this._value, e);
327
+ return Ke(this._value, e);
319
328
  }
320
329
  /**
321
330
  * Determine if a given string is a valid ULID.
@@ -323,7 +332,7 @@ class s {
323
332
  * @return True if the string is a valid ULID, false otherwise.
324
333
  */
325
334
  isUlid() {
326
- return Xe(this._value);
335
+ return He(this._value);
327
336
  }
328
337
  /**
329
338
  * Determine if the given string is empty.
@@ -347,7 +356,7 @@ class s {
347
356
  * @returns The kebab-cased string as a new Stringable instance.
348
357
  */
349
358
  kebab() {
350
- return new s(g(this._value));
359
+ return new s(b(this._value));
351
360
  }
352
361
  /**
353
362
  * Return the length of the given string.
@@ -355,7 +364,7 @@ class s {
355
364
  * @returns The length of the string.
356
365
  */
357
366
  length() {
358
- return b(this._value);
367
+ return S(this._value);
359
368
  }
360
369
  /**
361
370
  * Limit the number of characters in a string.
@@ -367,7 +376,7 @@ class s {
367
376
  */
368
377
  limit(e = 100, t = "...", r = !1) {
369
378
  return new s(
370
- S(this._value, e, t, r)
379
+ ee(this._value, e, t, r)
371
380
  );
372
381
  }
373
382
  /**
@@ -407,7 +416,7 @@ class s {
407
416
  * @returns The masked string as a new Stringable instance.
408
417
  */
409
418
  mask(e, t, r = null) {
410
- return new s(ee(this._value, e, t, r));
419
+ return new s(te(this._value, e, t, r));
411
420
  }
412
421
  /**
413
422
  * Get the string matching the given pattern.
@@ -416,7 +425,7 @@ class s {
416
425
  * @returns A new Stringable instance containing the matched string.
417
426
  */
418
427
  match(e) {
419
- return new s(te(e, this._value));
428
+ return new s(se(e, this._value));
420
429
  }
421
430
  /**
422
431
  * Determine if a given string matches a given pattern.
@@ -425,7 +434,7 @@ class s {
425
434
  * @returns boolean - True if the pattern(s) match, false otherwise
426
435
  */
427
436
  isMatch(e) {
428
- return se(e, this._value);
437
+ return re(e, this._value);
429
438
  }
430
439
  /**
431
440
  * Get the string matching the given pattern.
@@ -434,7 +443,7 @@ class s {
434
443
  * @returns An array of all matched strings.
435
444
  */
436
445
  matchAll(e) {
437
- return re(e, this._value);
446
+ return ne(e, this._value);
438
447
  }
439
448
  /**
440
449
  * Determine if the string matches the given pattern.
@@ -451,7 +460,7 @@ class s {
451
460
  * @returns The numeric string as a new Stringable instance.
452
461
  */
453
462
  numbers() {
454
- return new s(ne(this._value));
463
+ return new s(ue(this._value));
455
464
  }
456
465
  /**
457
466
  * Pad both sides of the string with another.
@@ -461,7 +470,7 @@ class s {
461
470
  * @returns The padded string as a new Stringable instance.
462
471
  */
463
472
  padBoth(e, t = " ") {
464
- return new s(ue(this._value, e, t));
473
+ return new s(ie(this._value, e, t));
465
474
  }
466
475
  /**
467
476
  * Pad the left side of the string with another.
@@ -471,7 +480,7 @@ class s {
471
480
  * @returns The padded string as a new Stringable instance.
472
481
  */
473
482
  padLeft(e, t = " ") {
474
- return new s(ie(this._value, e, t));
483
+ return new s(he(this._value, e, t));
475
484
  }
476
485
  /**
477
486
  * Pad the right side of the string with another.
@@ -481,7 +490,7 @@ class s {
481
490
  * @returns The padded string as a new Stringable instance.
482
491
  */
483
492
  padRight(e, t = " ") {
484
- return new s(he(this._value, e, t));
493
+ return new s(le(this._value, e, t));
485
494
  }
486
495
  /**
487
496
  * Call the given callback and return a new string.
@@ -496,12 +505,12 @@ class s {
496
505
  /**
497
506
  * Get the plural form of an English word.
498
507
  *
499
- * @param count - The count to determine singular or plural form. Defaults to 2.
508
+ * @param count - The count to determine singular or plural form. Arrays are counted by length. Defaults to 2.
500
509
  * @param prependCount - Whether to prepend the count to the result. Defaults to false.
501
510
  * @returns The pluralized string as a new Stringable instance.
502
511
  */
503
512
  plural(e = 2, t = !1) {
504
- return new s(W(this._value, e, t));
513
+ return new s(x(this._value, e, t));
505
514
  }
506
515
  /**
507
516
  * Pluralize the last word of an English, studly caps case string.
@@ -510,7 +519,7 @@ class s {
510
519
  * @returns The pluralized string as a new Stringable instance.
511
520
  */
512
521
  pluralStudly(e = 2) {
513
- return new s(x(this._value, e));
522
+ return new s(k(this._value, e));
514
523
  }
515
524
  /**
516
525
  * Pluralize the last word of an English, Pascal caps case string.
@@ -519,7 +528,7 @@ class s {
519
528
  * @returns The pluralized string as a new Stringable instance.
520
529
  */
521
530
  pluralPascal(e = 2) {
522
- return new s(k(this._value, e));
531
+ return new s(N(this._value, e));
523
532
  }
524
533
  /**
525
534
  * Find the multi-byte safe position of the first occurrence of the given substring.
@@ -529,7 +538,7 @@ class s {
529
538
  * @returns The position of the first occurrence of the substring, or false if not found.
530
539
  */
531
540
  position(e, t = 0) {
532
- return le(this._value, e, t);
541
+ return ae(this._value, e, t);
533
542
  }
534
543
  /**
535
544
  * Prepend the given values to the string.
@@ -549,7 +558,7 @@ class s {
549
558
  */
550
559
  remove(e, t = !0) {
551
560
  return new s(
552
- ae(e, this._value, t)
561
+ oe(e, this._value, t)
553
562
  );
554
563
  }
555
564
  /**
@@ -558,7 +567,7 @@ class s {
558
567
  * @returns The reversed string as a new Stringable instance.
559
568
  */
560
569
  reverse() {
561
- return new s(oe(this._value));
570
+ return new s(we(this._value));
562
571
  }
563
572
  /**
564
573
  * Repeat the string.
@@ -567,7 +576,7 @@ class s {
567
576
  * @returns The repeated string as a new Stringable instance.
568
577
  */
569
578
  repeat(e) {
570
- return new s(we(this._value, e));
579
+ return new s(ve(this._value, e));
571
580
  }
572
581
  /**
573
582
  * Replace the given value in the given string.
@@ -579,7 +588,7 @@ class s {
579
588
  */
580
589
  replace(e, t, r = !0) {
581
590
  return new s(
582
- ve(e, t, this._value, r)
591
+ ce(e, t, this._value, r)
583
592
  );
584
593
  }
585
594
  /**
@@ -590,7 +599,7 @@ class s {
590
599
  * @returns The updated Stringable instance.
591
600
  */
592
601
  replaceArray(e, t) {
593
- return new s(ce(e, t, this._value));
602
+ return new s(pe(e, t, this._value));
594
603
  }
595
604
  /**
596
605
  * Replace the first occurrence of a given value in the string.
@@ -600,7 +609,7 @@ class s {
600
609
  * @returns The updated Stringable instance.
601
610
  */
602
611
  replaceFirst(e, t) {
603
- return new s(pe(e, t, this._value));
612
+ return new s(de(e, t, this._value));
604
613
  }
605
614
  /**
606
615
  * Replace the first occurrence of the given value if it appears at the start of the string.
@@ -610,7 +619,7 @@ class s {
610
619
  * @returns The updated Stringable instance.
611
620
  */
612
621
  replaceStart(e, t) {
613
- return new s(de(e, t, this._value));
622
+ return new s(fe(e, t, this._value));
614
623
  }
615
624
  /**
616
625
  * Replace the last occurrence of a given value in the string.
@@ -620,7 +629,7 @@ class s {
620
629
  * @returns The updated Stringable instance.
621
630
  */
622
631
  replaceLast(e, t) {
623
- return new s(fe(e, t, this._value));
632
+ return new s(me(e, t, this._value));
624
633
  }
625
634
  /**
626
635
  * Replace the last occurrence of a given value if it appears at the end of the string.
@@ -630,7 +639,7 @@ class s {
630
639
  * @returns The updated Stringable instance.
631
640
  */
632
641
  replaceEnd(e, t) {
633
- return new s(me(e, t, this._value));
642
+ return new s(_e(e, t, this._value));
634
643
  }
635
644
  /**
636
645
  * Replace the patterns matching the given regular expression.
@@ -641,7 +650,7 @@ class s {
641
650
  * @returns The updated Stringable instance.
642
651
  */
643
652
  replaceMatches(e, t, r = -1) {
644
- const n = _e(e, t, this._value, r);
653
+ const n = Ee(e, t, this._value, r);
645
654
  return new s(n);
646
655
  }
647
656
  /**
@@ -680,7 +689,7 @@ class s {
680
689
  * @returns The updated Stringable instance.
681
690
  */
682
691
  squish() {
683
- return new s(Ee(this._value));
692
+ return new s(ye(this._value));
684
693
  }
685
694
  /**
686
695
  * Begin a string with a single instance of a given value.
@@ -689,7 +698,7 @@ class s {
689
698
  * @returns The updated Stringable instance.
690
699
  */
691
700
  start(e) {
692
- return new s(ye(this._value, e));
701
+ return new s(Ae(this._value, e));
693
702
  }
694
703
  /**
695
704
  * Strip HTML and PHP tags from the given string.
@@ -697,7 +706,7 @@ class s {
697
706
  * @returns The updated Stringable instance.
698
707
  */
699
708
  stripTags() {
700
- return new s(Ae(this._value));
709
+ return new s(We(this._value));
701
710
  }
702
711
  /**
703
712
  * Convert the given string to upper-case.
@@ -721,7 +730,7 @@ class s {
721
730
  * @returns The headline-cased string as a new Stringable instance.
722
731
  */
723
732
  headline() {
724
- return new s(We(this._value));
733
+ return new s(xe(this._value));
725
734
  }
726
735
  /**
727
736
  * Convert the given string to only its initials.
@@ -730,7 +739,7 @@ class s {
730
739
  * @returns The initials of the string as a new Stringable instance.
731
740
  */
732
741
  initials(e = !1) {
733
- return new s(xe(this._value, e));
742
+ return new s(ke(this._value, e));
734
743
  }
735
744
  /**
736
745
  * Convert the given string to APA-style title case.
@@ -738,7 +747,7 @@ class s {
738
747
  * @returns The APA title-cased string as a new Stringable instance.
739
748
  */
740
749
  apa() {
741
- return new s(ke(this._value));
750
+ return new s(Ne(this._value));
742
751
  }
743
752
  /**
744
753
  * Transliterate a string to its closest ASCII representation.
@@ -746,7 +755,7 @@ class s {
746
755
  * @returns The transliterated string as a new Stringable instance.
747
756
  */
748
757
  transliterate() {
749
- return new s($e(this._value));
758
+ return new s(ze(this._value));
750
759
  }
751
760
  /**
752
761
  * Get the singular form of an English word.
@@ -754,7 +763,7 @@ class s {
754
763
  * @returns The singularized string as a new Stringable instance.
755
764
  */
756
765
  singular() {
757
- return new s(N(this._value));
766
+ return new s(U(this._value));
758
767
  }
759
768
  /**
760
769
  * Generate a URL friendly "slug" from a given string.
@@ -773,7 +782,7 @@ class s {
773
782
  * @returns The snake-cased string as a new Stringable instance.
774
783
  */
775
784
  snake(e = "_") {
776
- return new s(Ne(this._value, e));
785
+ return new s(Ue(this._value, e));
777
786
  }
778
787
  /**
779
788
  * Determine if a given string starts with a given substring.
@@ -782,7 +791,7 @@ class s {
782
791
  * @returns boolean - True if the substring(s) are found, false otherwise
783
792
  */
784
793
  startsWith(e) {
785
- return Ue(this._value, e);
794
+ return Ce(this._value, e);
786
795
  }
787
796
  /**
788
797
  * Determine if a given string doesn't start with a given substring.
@@ -791,23 +800,25 @@ class s {
791
800
  * @returns boolean - True if the substring(s) are not found, false otherwise
792
801
  */
793
802
  doesntStartWith(e) {
794
- return Ce(this._value, e);
803
+ return Le(this._value, e);
795
804
  }
796
805
  /**
797
806
  * Convert a value to studly caps case.
798
807
  *
808
+ * @param normalize - When true, all-uppercase words (e.g. acronyms) are lowercased before conversion so "CBOR" becomes "Cbor" instead of "CBOR". Defaults to false.
799
809
  * @returns The studly-cased string as a new Stringable instance.
800
810
  */
801
- studly() {
802
- return new s(Le(this._value));
811
+ studly(e = !1) {
812
+ return new s(Me(this._value, e));
803
813
  }
804
814
  /**
805
815
  * Convert the string to Pascal case.
806
816
  *
817
+ * @param normalize - When true, all-uppercase words (e.g. acronyms) are lowercased before conversion so "CBOR" becomes "Cbor" instead of "CBOR". Defaults to false.
807
818
  * @returns The pascal-cased string as a new Stringable instance.
808
819
  */
809
- pascal() {
810
- return new s(Me(this._value));
820
+ pascal(e = !1) {
821
+ return new s(Fe(this._value, e));
811
822
  }
812
823
  /**
813
824
  * Returns the portion of the string specified by the start and length parameters.
@@ -817,7 +828,7 @@ class s {
817
828
  * @returns The extracted substring as a new Stringable instance.
818
829
  */
819
830
  substr(e, t = null) {
820
- return new s(U(this._value, e, t));
831
+ return new s(C(this._value, e, t));
821
832
  }
822
833
  /**
823
834
  * Returns the number of substring occurrences.
@@ -828,7 +839,7 @@ class s {
828
839
  * @returns The number of occurrences of the substring.
829
840
  */
830
841
  substrCount(e, t = 0, r = null) {
831
- return C(this._value, e, t, r);
842
+ return L(this._value, e, t, r);
832
843
  }
833
844
  /**
834
845
  * Replace text within a portion of a string.
@@ -840,7 +851,7 @@ class s {
840
851
  */
841
852
  substrReplace(e, t = 0, r = null) {
842
853
  return new s(
843
- L(this._value, e, t, r)
854
+ M(this._value, e, t, r)
844
855
  );
845
856
  }
846
857
  /**
@@ -850,7 +861,7 @@ class s {
850
861
  * @returns The updated Stringable instance.
851
862
  */
852
863
  swap(e) {
853
- return new s(Fe(e, this._value));
864
+ return new s(Ie(e, this._value));
854
865
  }
855
866
  /**
856
867
  * Take the first or last {$limit} characters.
@@ -859,7 +870,7 @@ class s {
859
870
  * @returns The resulting substring as a new Stringable instance.
860
871
  */
861
872
  take(e) {
862
- return new s(Ie(this._value, e));
873
+ return new s(Be(this._value, e));
863
874
  }
864
875
  /**
865
876
  * Trim the string of the given characters.
@@ -877,7 +888,7 @@ class s {
877
888
  * @returns The left-trimmed string as a new Stringable instance.
878
889
  */
879
890
  ltrim(e = null) {
880
- return new s(ze(this._value, e));
891
+ return new s(Ge(this._value, e));
881
892
  }
882
893
  /**
883
894
  * Right trim the string of the given characters.
@@ -886,7 +897,7 @@ class s {
886
897
  * @returns The right-trimmed string as a new Stringable instance.
887
898
  */
888
899
  rtrim(e = null) {
889
- return new s(Ge(this._value, e));
900
+ return new s(Xe(this._value, e));
890
901
  }
891
902
  /**
892
903
  * Make a string's first character lowercase.
@@ -894,7 +905,7 @@ class s {
894
905
  * @returns The updated Stringable instance.
895
906
  */
896
907
  lcfirst() {
897
- return new s(Be(this._value));
908
+ return new s(Re(this._value));
898
909
  }
899
910
  /**
900
911
  * Make a string's first character uppercase.
@@ -902,7 +913,7 @@ class s {
902
913
  * @returns The updated Stringable instance.
903
914
  */
904
915
  ucfirst() {
905
- return new s(Re(this._value));
916
+ return new s(je(this._value));
906
917
  }
907
918
  /**
908
919
  * Split a string by uppercase characters.
@@ -910,7 +921,7 @@ class s {
910
921
  * @returns An array of substrings split at uppercase characters.
911
922
  */
912
923
  ucsplit() {
913
- return je(this._value);
924
+ return De(this._value);
914
925
  }
915
926
  /**
916
927
  * Uppercase the first character of each word in a string.
@@ -918,7 +929,7 @@ class s {
918
929
  * @returns The updated Stringable instance.
919
930
  */
920
931
  ucwords() {
921
- return new s(De(this._value));
932
+ return new s(Te(this._value));
922
933
  }
923
934
  /**
924
935
  * Apply the callback if the given "value" is (or resolves to) truthy.
@@ -1129,7 +1140,7 @@ class s {
1129
1140
  * @returns The truncated string as a new Stringable instance.
1130
1141
  */
1131
1142
  words(e = 100, t = "...") {
1132
- return new s(Te(this._value, e, t));
1143
+ return new s(Pe(this._value, e, t));
1133
1144
  }
1134
1145
  /**
1135
1146
  * Get the number of words a string contains.
@@ -1138,7 +1149,7 @@ class s {
1138
1149
  * @returns The number of words in the string.
1139
1150
  */
1140
1151
  wordCount(e = null) {
1141
- return Pe(this._value, e);
1152
+ return qe(this._value, e);
1142
1153
  }
1143
1154
  /**
1144
1155
  * Wrap a string to a given number of characters.
@@ -1151,7 +1162,7 @@ class s {
1151
1162
  wordWrap(e = 75, t = `
1152
1163
  `, r = !1) {
1153
1164
  return new s(
1154
- qe(this._value, e, t, r)
1165
+ Je(this._value, e, t, r)
1155
1166
  );
1156
1167
  }
1157
1168
  /**
@@ -1162,7 +1173,7 @@ class s {
1162
1173
  * @returns The wrapped string as a new Stringable instance.
1163
1174
  */
1164
1175
  wrap(e, t = null) {
1165
- return new s(Je(this._value, e, t));
1176
+ return new s(Ve(this._value, e, t));
1166
1177
  }
1167
1178
  /**
1168
1179
  * Unwrap the string with the given strings.
@@ -1172,7 +1183,7 @@ class s {
1172
1183
  * @returns The unwrapped string as a new Stringable instance.
1173
1184
  */
1174
1185
  unwrap(e, t = null) {
1175
- return new s(Ve(this._value, e, t));
1186
+ return new s($e(this._value, e, t));
1176
1187
  }
1177
1188
  /**
1178
1189
  * Convert the string to Base64 encoding.
@@ -1255,6 +1266,6 @@ class s {
1255
1266
  }
1256
1267
  export {
1257
1268
  s as Stringable,
1258
- nt as of,
1259
- ut as str
1269
+ ut as of,
1270
+ it as str
1260
1271
  };