@tolki/str 1.0.8 → 1.0.10
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/README.md +121 -105
- package/dist/index.js +78 -77
- package/dist/str.d.ts +10 -0
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +75 -70
- package/dist/stringable/index.d.ts +6 -0
- package/dist/stringable/index.d.ts.map +1 -1
- package/dist/stringable/index.js +39 -31
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stringable/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stringable/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8EvE,MAAM,MAAM,kBAAkB,GACxB,MAAM,GACN,MAAM,GACN,OAAO,GACP,CAAC,CAAC,QAAQ,EAAE,UAAU,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAE5D,MAAM,MAAM,oBAAoB,GAC1B,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,GAC9D,IAAI,CAAC;AAEX;;;;;;;GAOG;AACH,wBAAgB,EAAE,CAAC,KAAK,GAAE,MAAW,GAAG,UAAU,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,KAAK,GAAE,MAAW,GAAG,UAAU,CAElD;AAED,qBAAa,UAAU;IAMP,OAAO,CAAC,QAAQ,CAAC,MAAM;IALnC;;;;OA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CACJ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,oBAAoB,EAC9B,eAAe,GAAE,oBAA2B;IAKhD;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,GAAE,MAAY,EAAE,GAAG,GAAE,MAAc,GAAG,UAAU;IAIhE;;;;;OAKG;IACH,SAAS,CAAC,UAAU,GAAE,MAAM,GAAG,IAAW,GAAG,MAAM;IAInD;;;;;;;OAOG;IACH,QAAQ,CACJ,UAAU,SAAK,EACf,QAAQ,SAAO,EACf,YAAY,UAAQ,GACrB,UAAU;IAMb;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,GAAG,UAAU;IAI7D;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,GAAG,UAAU;IAI/D;;;;OAIG;IACH,QAAQ,IAAI,UAAU;IAItB;;;;;OAKG;IACH,UAAU,CAAC,MAAM,UAAQ,GAAG,UAAU,GAAG,KAAK;IAK9C;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;OAIG;IACH,KAAK,IAAI,MAAM;IAIf;;;;;OAKG;IACH,SAAS,CAAC,IAAI,SAAK,GAAG,MAAM;IAK5B;;;;OAIG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,SAAS,IAAI,OAAO;IAMpB;;;;OAIG;IACH,MAAM,IAAI,IAAI,GAAG,IAAI;IAKrB;;;;OAIG;IACH,aAAa,IAAI,MAAM;CAG1B"}
|
package/dist/stringable/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { convertCase as m, upper as _, title as E } from "../convertcase/index.j
|
|
|
5
5
|
import { markdown as y, inlineMarkdown as A } from "../markdown/index.js";
|
|
6
6
|
import { plural as W, pluralStudly as x, pluralPascal as k, singular as N } from "../pluralizer/index.js";
|
|
7
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,
|
|
9
|
-
import { transliterate as
|
|
10
|
-
import { trim as o, ltrim as
|
|
11
|
-
import { isUlid as
|
|
12
|
-
import { isUuid as
|
|
13
|
-
function
|
|
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 = "") {
|
|
14
14
|
return new s(h);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function ut(h = "") {
|
|
17
17
|
return new s(h);
|
|
18
18
|
}
|
|
19
19
|
class s {
|
|
@@ -314,7 +314,7 @@ class s {
|
|
|
314
314
|
* @returns True if the string is a valid UUID, false otherwise.
|
|
315
315
|
*/
|
|
316
316
|
isUuid(e = null) {
|
|
317
|
-
return
|
|
317
|
+
return He(this._value, e);
|
|
318
318
|
}
|
|
319
319
|
/**
|
|
320
320
|
* Determine if a given string is a valid ULID.
|
|
@@ -322,7 +322,7 @@ class s {
|
|
|
322
322
|
* @return True if the string is a valid ULID, false otherwise.
|
|
323
323
|
*/
|
|
324
324
|
isUlid() {
|
|
325
|
-
return
|
|
325
|
+
return Xe(this._value);
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
328
328
|
* Determine if the given string is empty.
|
|
@@ -722,13 +722,21 @@ class s {
|
|
|
722
722
|
headline() {
|
|
723
723
|
return new s(We(this._value));
|
|
724
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Convert the given string to only its initials.
|
|
727
|
+
*
|
|
728
|
+
* @returns The initials of the string as a new Stringable instance.
|
|
729
|
+
*/
|
|
730
|
+
initials() {
|
|
731
|
+
return new s(xe(this._value));
|
|
732
|
+
}
|
|
725
733
|
/**
|
|
726
734
|
* Convert the given string to APA-style title case.
|
|
727
735
|
*
|
|
728
736
|
* @returns The APA title-cased string as a new Stringable instance.
|
|
729
737
|
*/
|
|
730
738
|
apa() {
|
|
731
|
-
return new s(
|
|
739
|
+
return new s(ke(this._value));
|
|
732
740
|
}
|
|
733
741
|
/**
|
|
734
742
|
* Transliterate a string to its closest ASCII representation.
|
|
@@ -736,7 +744,7 @@ class s {
|
|
|
736
744
|
* @returns The transliterated string as a new Stringable instance.
|
|
737
745
|
*/
|
|
738
746
|
transliterate() {
|
|
739
|
-
return new s(
|
|
747
|
+
return new s($e(this._value));
|
|
740
748
|
}
|
|
741
749
|
/**
|
|
742
750
|
* Get the singular form of an English word.
|
|
@@ -763,7 +771,7 @@ class s {
|
|
|
763
771
|
* @returns The snake-cased string as a new Stringable instance.
|
|
764
772
|
*/
|
|
765
773
|
snake(e = "_") {
|
|
766
|
-
return new s(
|
|
774
|
+
return new s(Ne(this._value, e));
|
|
767
775
|
}
|
|
768
776
|
/**
|
|
769
777
|
* Determine if a given string starts with a given substring.
|
|
@@ -772,7 +780,7 @@ class s {
|
|
|
772
780
|
* @returns boolean - True if the substring(s) are found, false otherwise
|
|
773
781
|
*/
|
|
774
782
|
startsWith(e) {
|
|
775
|
-
return
|
|
783
|
+
return Ue(this._value, e);
|
|
776
784
|
}
|
|
777
785
|
/**
|
|
778
786
|
* Determine if a given string doesn't start with a given substring.
|
|
@@ -781,7 +789,7 @@ class s {
|
|
|
781
789
|
* @returns boolean - True if the substring(s) are not found, false otherwise
|
|
782
790
|
*/
|
|
783
791
|
doesntStartWith(e) {
|
|
784
|
-
return
|
|
792
|
+
return Ce(this._value, e);
|
|
785
793
|
}
|
|
786
794
|
/**
|
|
787
795
|
* Convert a value to studly caps case.
|
|
@@ -789,7 +797,7 @@ class s {
|
|
|
789
797
|
* @returns The studly-cased string as a new Stringable instance.
|
|
790
798
|
*/
|
|
791
799
|
studly() {
|
|
792
|
-
return new s(
|
|
800
|
+
return new s(Le(this._value));
|
|
793
801
|
}
|
|
794
802
|
/**
|
|
795
803
|
* Convert the string to Pascal case.
|
|
@@ -797,7 +805,7 @@ class s {
|
|
|
797
805
|
* @returns The pascal-cased string as a new Stringable instance.
|
|
798
806
|
*/
|
|
799
807
|
pascal() {
|
|
800
|
-
return new s(
|
|
808
|
+
return new s(Me(this._value));
|
|
801
809
|
}
|
|
802
810
|
/**
|
|
803
811
|
* Returns the portion of the string specified by the start and length parameters.
|
|
@@ -840,7 +848,7 @@ class s {
|
|
|
840
848
|
* @returns The updated Stringable instance.
|
|
841
849
|
*/
|
|
842
850
|
swap(e) {
|
|
843
|
-
return new s(
|
|
851
|
+
return new s(Fe(e, this._value));
|
|
844
852
|
}
|
|
845
853
|
/**
|
|
846
854
|
* Take the first or last {$limit} characters.
|
|
@@ -849,7 +857,7 @@ class s {
|
|
|
849
857
|
* @returns The resulting substring as a new Stringable instance.
|
|
850
858
|
*/
|
|
851
859
|
take(e) {
|
|
852
|
-
return new s(
|
|
860
|
+
return new s(Ie(this._value, e));
|
|
853
861
|
}
|
|
854
862
|
/**
|
|
855
863
|
* Trim the string of the given characters.
|
|
@@ -867,7 +875,7 @@ class s {
|
|
|
867
875
|
* @returns The left-trimmed string as a new Stringable instance.
|
|
868
876
|
*/
|
|
869
877
|
ltrim(e = null) {
|
|
870
|
-
return new s(
|
|
878
|
+
return new s(ze(this._value, e));
|
|
871
879
|
}
|
|
872
880
|
/**
|
|
873
881
|
* Right trim the string of the given characters.
|
|
@@ -876,7 +884,7 @@ class s {
|
|
|
876
884
|
* @returns The right-trimmed string as a new Stringable instance.
|
|
877
885
|
*/
|
|
878
886
|
rtrim(e = null) {
|
|
879
|
-
return new s(
|
|
887
|
+
return new s(Ge(this._value, e));
|
|
880
888
|
}
|
|
881
889
|
/**
|
|
882
890
|
* Make a string's first character lowercase.
|
|
@@ -884,7 +892,7 @@ class s {
|
|
|
884
892
|
* @returns The updated Stringable instance.
|
|
885
893
|
*/
|
|
886
894
|
lcfirst() {
|
|
887
|
-
return new s(
|
|
895
|
+
return new s(Be(this._value));
|
|
888
896
|
}
|
|
889
897
|
/**
|
|
890
898
|
* Make a string's first character uppercase.
|
|
@@ -892,7 +900,7 @@ class s {
|
|
|
892
900
|
* @returns The updated Stringable instance.
|
|
893
901
|
*/
|
|
894
902
|
ucfirst() {
|
|
895
|
-
return new s(
|
|
903
|
+
return new s(Re(this._value));
|
|
896
904
|
}
|
|
897
905
|
/**
|
|
898
906
|
* Split a string by uppercase characters.
|
|
@@ -900,7 +908,7 @@ class s {
|
|
|
900
908
|
* @returns An array of substrings split at uppercase characters.
|
|
901
909
|
*/
|
|
902
910
|
ucsplit() {
|
|
903
|
-
return
|
|
911
|
+
return je(this._value);
|
|
904
912
|
}
|
|
905
913
|
/**
|
|
906
914
|
* Uppercase the first character of each word in a string.
|
|
@@ -908,7 +916,7 @@ class s {
|
|
|
908
916
|
* @returns The updated Stringable instance.
|
|
909
917
|
*/
|
|
910
918
|
ucwords() {
|
|
911
|
-
return new s(
|
|
919
|
+
return new s(De(this._value));
|
|
912
920
|
}
|
|
913
921
|
/**
|
|
914
922
|
* Apply the callback if the given "value" is (or resolves to) truthy.
|
|
@@ -1119,7 +1127,7 @@ class s {
|
|
|
1119
1127
|
* @returns The truncated string as a new Stringable instance.
|
|
1120
1128
|
*/
|
|
1121
1129
|
words(e = 100, t = "...") {
|
|
1122
|
-
return new s(
|
|
1130
|
+
return new s(Te(this._value, e, t));
|
|
1123
1131
|
}
|
|
1124
1132
|
/**
|
|
1125
1133
|
* Get the number of words a string contains.
|
|
@@ -1128,7 +1136,7 @@ class s {
|
|
|
1128
1136
|
* @returns The number of words in the string.
|
|
1129
1137
|
*/
|
|
1130
1138
|
wordCount(e = null) {
|
|
1131
|
-
return
|
|
1139
|
+
return Pe(this._value, e);
|
|
1132
1140
|
}
|
|
1133
1141
|
/**
|
|
1134
1142
|
* Wrap a string to a given number of characters.
|
|
@@ -1141,7 +1149,7 @@ class s {
|
|
|
1141
1149
|
wordWrap(e = 75, t = `
|
|
1142
1150
|
`, r = !1) {
|
|
1143
1151
|
return new s(
|
|
1144
|
-
|
|
1152
|
+
qe(this._value, e, t, r)
|
|
1145
1153
|
);
|
|
1146
1154
|
}
|
|
1147
1155
|
/**
|
|
@@ -1152,7 +1160,7 @@ class s {
|
|
|
1152
1160
|
* @returns The wrapped string as a new Stringable instance.
|
|
1153
1161
|
*/
|
|
1154
1162
|
wrap(e, t = null) {
|
|
1155
|
-
return new s(
|
|
1163
|
+
return new s(Je(this._value, e, t));
|
|
1156
1164
|
}
|
|
1157
1165
|
/**
|
|
1158
1166
|
* Unwrap the string with the given strings.
|
|
@@ -1162,7 +1170,7 @@ class s {
|
|
|
1162
1170
|
* @returns The unwrapped string as a new Stringable instance.
|
|
1163
1171
|
*/
|
|
1164
1172
|
unwrap(e, t = null) {
|
|
1165
|
-
return new s(
|
|
1173
|
+
return new s(Ve(this._value, e, t));
|
|
1166
1174
|
}
|
|
1167
1175
|
/**
|
|
1168
1176
|
* Convert the string to Base64 encoding.
|
|
@@ -1245,6 +1253,6 @@ class s {
|
|
|
1245
1253
|
}
|
|
1246
1254
|
export {
|
|
1247
1255
|
s as Stringable,
|
|
1248
|
-
|
|
1249
|
-
|
|
1256
|
+
nt as of,
|
|
1257
|
+
ut as str
|
|
1250
1258
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/str",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"transliteration": "^2.6.0",
|
|
37
37
|
"ulid": "^2.4.0",
|
|
38
38
|
"uuid": "^11.1.0",
|
|
39
|
-
"@tolki/num": "^2.0.
|
|
39
|
+
"@tolki/num": "^2.0.3",
|
|
40
40
|
"@tolki/utils": "^1.0.2"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|