@thi.ng/strings 3.0.3 → 3.1.4
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/CHANGELOG.md +119 -116
- package/README.md +1 -1
- package/entities.d.ts +7 -0
- package/entities.js +24 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +10 -7
- package/units.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [3.
|
|
6
|
+
## [3.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.1.3...@thi.ng/strings@3.1.4) (2021-11-10)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @thi.ng/strings
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
## [3.
|
|
14
|
+
## [3.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.1.2...@thi.ng/strings@3.1.3) (2021-11-03)
|
|
15
15
|
|
|
16
16
|
**Note:** Version bump only for package @thi.ng/strings
|
|
17
17
|
|
|
@@ -19,9 +19,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
# [3.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.0.3...@thi.ng/strings@3.1.0) (2021-10-25)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **strings:** migrate/add entities, regexes, fns ([57c246d](https://github.com/thi-ng/umbrella/commit/57c246df06279a2e70cfb28ce34ff8d9666b0199))
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
|
|
@@ -61,211 +64,211 @@ Also:
|
|
|
61
64
|
|
|
62
65
|
|
|
63
66
|
|
|
64
|
-
# [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@2.0.0...@thi.ng/strings@2.1.0) (2021-03-24)
|
|
67
|
+
# [2.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@2.0.0...@thi.ng/strings@2.1.0) (2021-03-24)
|
|
65
68
|
|
|
66
|
-
### Features
|
|
69
|
+
### Features
|
|
67
70
|
|
|
68
|
-
- **strings:** add ruler(), grid() fns, update readme ([d93cbf9](https://github.com/thi-ng/umbrella/commit/d93cbf9708c414e703fde61e80b5762f34899aa4))
|
|
71
|
+
- **strings:** add ruler(), grid() fns, update readme ([d93cbf9](https://github.com/thi-ng/umbrella/commit/d93cbf9708c414e703fde61e80b5762f34899aa4))
|
|
69
72
|
|
|
70
|
-
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.15.6...@thi.ng/strings@2.0.0) (2021-03-24)
|
|
73
|
+
# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.15.6...@thi.ng/strings@2.0.0) (2021-03-24)
|
|
71
74
|
|
|
72
|
-
### Features
|
|
75
|
+
### Features
|
|
73
76
|
|
|
74
|
-
- **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
|
|
75
|
-
- **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
|
|
76
|
-
- **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
|
|
77
|
+
- **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
|
|
78
|
+
- **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
|
|
79
|
+
- **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
|
|
77
80
|
|
|
78
|
-
### BREAKING CHANGES
|
|
81
|
+
### BREAKING CHANGES
|
|
79
82
|
|
|
80
|
-
- **strings:** major update wordWrap(), wordWrapLines() etc.
|
|
81
|
-
- update arguments
|
|
82
|
-
- add `WordWrapOpts` to configure wordwrap behavior
|
|
83
|
-
- add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
|
|
84
|
-
- implement hardwrap mode
|
|
83
|
+
- **strings:** major update wordWrap(), wordWrapLines() etc.
|
|
84
|
+
- update arguments
|
|
85
|
+
- add `WordWrapOpts` to configure wordwrap behavior
|
|
86
|
+
- add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
|
|
87
|
+
- implement hardwrap mode
|
|
85
88
|
|
|
86
|
-
# [1.15.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.14.0...@thi.ng/strings@1.15.0) (2021-02-20)
|
|
89
|
+
# [1.15.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.14.0...@thi.ng/strings@1.15.0) (2021-02-20)
|
|
87
90
|
|
|
88
|
-
### Features
|
|
91
|
+
### Features
|
|
89
92
|
|
|
90
|
-
- **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
|
|
93
|
+
- **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
|
|
91
94
|
|
|
92
|
-
# [1.14.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.13.0...@thi.ng/strings@1.14.0) (2021-01-13)
|
|
95
|
+
# [1.14.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.13.0...@thi.ng/strings@1.14.0) (2021-01-13)
|
|
93
96
|
|
|
94
|
-
### Features
|
|
97
|
+
### Features
|
|
95
98
|
|
|
96
|
-
- **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
|
|
99
|
+
- **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
|
|
97
100
|
|
|
98
|
-
# [1.13.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.12.0...@thi.ng/strings@1.13.0) (2021-01-10)
|
|
101
|
+
# [1.13.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.12.0...@thi.ng/strings@1.13.0) (2021-01-10)
|
|
99
102
|
|
|
100
|
-
### Features
|
|
103
|
+
### Features
|
|
101
104
|
|
|
102
|
-
- **strings:** add stripAnsi(), lengthAnsi() fns ([86fa81a](https://github.com/thi-ng/umbrella/commit/86fa81acb7dfcf1dc3d6f5600cbf427ee44cf722))
|
|
103
|
-
- **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
|
|
104
|
-
- **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
|
|
105
|
-
- **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
|
|
105
|
+
- **strings:** add stripAnsi(), lengthAnsi() fns ([86fa81a](https://github.com/thi-ng/umbrella/commit/86fa81acb7dfcf1dc3d6f5600cbf427ee44cf722))
|
|
106
|
+
- **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
|
|
107
|
+
- **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
|
|
108
|
+
- **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
|
|
106
109
|
|
|
107
|
-
### Performance Improvements
|
|
110
|
+
### Performance Improvements
|
|
108
111
|
|
|
109
|
-
- **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
|
|
112
|
+
- **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
|
|
110
113
|
|
|
111
|
-
# [1.12.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.11.4...@thi.ng/strings@1.12.0) (2021-01-05)
|
|
114
|
+
# [1.12.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.11.4...@thi.ng/strings@1.12.0) (2021-01-05)
|
|
112
115
|
|
|
113
|
-
### Features
|
|
116
|
+
### Features
|
|
114
117
|
|
|
115
|
-
- **strings:** add interpolateKeys() ([bd78d1d](https://github.com/thi-ng/umbrella/commit/bd78d1dba5e467e6cda452e6db6fcd0fb9a3cf19))
|
|
118
|
+
- **strings:** add interpolateKeys() ([bd78d1d](https://github.com/thi-ng/umbrella/commit/bd78d1dba5e467e6cda452e6db6fcd0fb9a3cf19))
|
|
116
119
|
|
|
117
|
-
## [1.11.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.11.3...@thi.ng/strings@1.11.4) (2021-01-02)
|
|
120
|
+
## [1.11.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.11.3...@thi.ng/strings@1.11.4) (2021-01-02)
|
|
118
121
|
|
|
119
|
-
### Bug Fixes
|
|
122
|
+
### Bug Fixes
|
|
120
123
|
|
|
121
|
-
- **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
|
|
124
|
+
- **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
|
|
122
125
|
|
|
123
|
-
# [1.11.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.10.0...@thi.ng/strings@1.11.0) (2020-11-24)
|
|
126
|
+
# [1.11.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.10.0...@thi.ng/strings@1.11.0) (2020-11-24)
|
|
124
127
|
|
|
125
|
-
### Features
|
|
128
|
+
### Features
|
|
126
129
|
|
|
127
|
-
- **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
|
|
130
|
+
- **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
|
|
128
131
|
|
|
129
|
-
# [1.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.9.6...@thi.ng/strings@1.10.0) (2020-09-22)
|
|
132
|
+
# [1.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.9.6...@thi.ng/strings@1.10.0) (2020-09-22)
|
|
130
133
|
|
|
131
|
-
### Features
|
|
134
|
+
### Features
|
|
132
135
|
|
|
133
|
-
- **strings:** add BOM const, update pkg meta ([b6751fc](https://github.com/thi-ng/umbrella/commit/b6751fc506a28a075ea9fee1a5f6d3520449f5af))
|
|
134
|
-
- **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
|
|
135
|
-
- **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
|
|
136
|
+
- **strings:** add BOM const, update pkg meta ([b6751fc](https://github.com/thi-ng/umbrella/commit/b6751fc506a28a075ea9fee1a5f6d3520449f5af))
|
|
137
|
+
- **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
|
|
138
|
+
- **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
|
|
136
139
|
|
|
137
|
-
# [1.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.8.13...@thi.ng/strings@1.9.0) (2020-07-08)
|
|
140
|
+
# [1.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.8.13...@thi.ng/strings@1.9.0) (2020-07-08)
|
|
138
141
|
|
|
139
|
-
### Features
|
|
142
|
+
### Features
|
|
140
143
|
|
|
141
|
-
- **strings:** add computeCursorPos() ([c178d00](https://github.com/thi-ng/umbrella/commit/c178d00edcdbe12cec492a1629c80bf359116b66))
|
|
144
|
+
- **strings:** add computeCursorPos() ([c178d00](https://github.com/thi-ng/umbrella/commit/c178d00edcdbe12cec492a1629c80bf359116b66))
|
|
142
145
|
|
|
143
|
-
# [1.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.7.0...@thi.ng/strings@1.8.0) (2020-03-28)
|
|
146
|
+
# [1.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.7.0...@thi.ng/strings@1.8.0) (2020-03-28)
|
|
144
147
|
|
|
145
|
-
### Features
|
|
148
|
+
### Features
|
|
146
149
|
|
|
147
|
-
- **strings:** add join() HOF ([1c5c46f](https://github.com/thi-ng/umbrella/commit/1c5c46f5ac832865266613a6d71024507238b694))
|
|
148
|
-
- **strings:** add slugifyGH(), refactor slugify() ([1ef805b](https://github.com/thi-ng/umbrella/commit/1ef805be3f0347751eba6da0122e1277a5b81e21))
|
|
149
|
-
- **strings:** add trim() HOF ([350a6c6](https://github.com/thi-ng/umbrella/commit/350a6c6cb010e00f2053fb41eeb0f458ee8fb715))
|
|
150
|
+
- **strings:** add join() HOF ([1c5c46f](https://github.com/thi-ng/umbrella/commit/1c5c46f5ac832865266613a6d71024507238b694))
|
|
151
|
+
- **strings:** add slugifyGH(), refactor slugify() ([1ef805b](https://github.com/thi-ng/umbrella/commit/1ef805be3f0347751eba6da0122e1277a5b81e21))
|
|
152
|
+
- **strings:** add trim() HOF ([350a6c6](https://github.com/thi-ng/umbrella/commit/350a6c6cb010e00f2053fb41eeb0f458ee8fb715))
|
|
150
153
|
|
|
151
|
-
# [1.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.6.0...@thi.ng/strings@1.7.0) (2020-03-06)
|
|
154
|
+
# [1.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.6.0...@thi.ng/strings@1.7.0) (2020-03-06)
|
|
152
155
|
|
|
153
|
-
### Features
|
|
156
|
+
### Features
|
|
154
157
|
|
|
155
|
-
- **strings:** add char group LUTs for classification ([c3ff006](https://github.com/thi-ng/umbrella/commit/c3ff006b237bece057f675d62a47d29bab9df413))
|
|
158
|
+
- **strings:** add char group LUTs for classification ([c3ff006](https://github.com/thi-ng/umbrella/commit/c3ff006b237bece057f675d62a47d29bab9df413))
|
|
156
159
|
|
|
157
|
-
# [1.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.5.2...@thi.ng/strings@1.6.0) (2020-03-01)
|
|
160
|
+
# [1.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.5.2...@thi.ng/strings@1.6.0) (2020-03-01)
|
|
158
161
|
|
|
159
|
-
### Features
|
|
162
|
+
### Features
|
|
160
163
|
|
|
161
|
-
- **strings:** add defFormat() HOF ([62f4e04](https://github.com/thi-ng/umbrella/commit/62f4e04c72e8822930da3f337898dae0ea51f6d0))
|
|
164
|
+
- **strings:** add defFormat() HOF ([62f4e04](https://github.com/thi-ng/umbrella/commit/62f4e04c72e8822930da3f337898dae0ea51f6d0))
|
|
162
165
|
|
|
163
|
-
# [1.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.4.0...@thi.ng/strings@1.5.0) (2020-02-25)
|
|
166
|
+
# [1.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.4.0...@thi.ng/strings@1.5.0) (2020-02-25)
|
|
164
167
|
|
|
165
|
-
### Features
|
|
168
|
+
### Features
|
|
166
169
|
|
|
167
|
-
- **strings:** add uuid() formatter ([4592742](https://github.com/thi-ng/umbrella/commit/4592742daad1020aa336e3d819324f4555223160))
|
|
170
|
+
- **strings:** add uuid() formatter ([4592742](https://github.com/thi-ng/umbrella/commit/4592742daad1020aa336e3d819324f4555223160))
|
|
168
171
|
|
|
169
|
-
# [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.3.3...@thi.ng/strings@1.4.0) (2020-01-26)
|
|
172
|
+
# [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.3.3...@thi.ng/strings@1.4.0) (2020-01-26)
|
|
170
173
|
|
|
171
|
-
### Features
|
|
174
|
+
### Features
|
|
172
175
|
|
|
173
|
-
- **strings:** add format() helpers (str, ignore) ([df87b7c](https://github.com/thi-ng/umbrella/commit/df87b7c7f0a1f9fa5b299fe8311fda02f40ab4cd))
|
|
174
|
-
- **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
|
|
176
|
+
- **strings:** add format() helpers (str, ignore) ([df87b7c](https://github.com/thi-ng/umbrella/commit/df87b7c7f0a1f9fa5b299fe8311fda02f40ab4cd))
|
|
177
|
+
- **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
|
|
175
178
|
|
|
176
|
-
# [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.2.3...@thi.ng/strings@1.3.0) (2019-09-21)
|
|
179
|
+
# [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.2.3...@thi.ng/strings@1.3.0) (2019-09-21)
|
|
177
180
|
|
|
178
|
-
### Features
|
|
181
|
+
### Features
|
|
179
182
|
|
|
180
|
-
- **strings:** add charRange(), add radix & zero-pad presets ([c9e5a63](https://github.com/thi-ng/umbrella/commit/c9e5a63))
|
|
183
|
+
- **strings:** add charRange(), add radix & zero-pad presets ([c9e5a63](https://github.com/thi-ng/umbrella/commit/c9e5a63))
|
|
181
184
|
|
|
182
|
-
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.1.3...@thi.ng/strings@1.2.0) (2019-07-07)
|
|
185
|
+
# [1.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.1.3...@thi.ng/strings@1.2.0) (2019-07-07)
|
|
183
186
|
|
|
184
|
-
### Features
|
|
187
|
+
### Features
|
|
185
188
|
|
|
186
|
-
- **strings:** enable TS strict compiler flags (refactor) ([76cecb8](https://github.com/thi-ng/umbrella/commit/76cecb8))
|
|
189
|
+
- **strings:** enable TS strict compiler flags (refactor) ([76cecb8](https://github.com/thi-ng/umbrella/commit/76cecb8))
|
|
187
190
|
|
|
188
|
-
# [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.0.7...@thi.ng/strings@1.1.0) (2019-04-15)
|
|
191
|
+
# [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.0.7...@thi.ng/strings@1.1.0) (2019-04-15)
|
|
189
192
|
|
|
190
|
-
### Features
|
|
193
|
+
### Features
|
|
191
194
|
|
|
192
|
-
- **strings:** add hstr() (hollerith) ([619e9ef](https://github.com/thi-ng/umbrella/commit/619e9ef))
|
|
195
|
+
- **strings:** add hstr() (hollerith) ([619e9ef](https://github.com/thi-ng/umbrella/commit/619e9ef))
|
|
193
196
|
|
|
194
|
-
## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.0.1...@thi.ng/strings@1.0.2) (2019-01-31)
|
|
197
|
+
## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.0.1...@thi.ng/strings@1.0.2) (2019-01-31)
|
|
195
198
|
|
|
196
|
-
### Bug Fixes
|
|
199
|
+
### Bug Fixes
|
|
197
200
|
|
|
198
|
-
- **strings:** fix [#70](https://github.com/thi-ng/umbrella/issues/70), replace kebab() regex w/ legacy version ([3adabc4](https://github.com/thi-ng/umbrella/commit/3adabc4))
|
|
201
|
+
- **strings:** fix [#70](https://github.com/thi-ng/umbrella/issues/70), replace kebab() regex w/ legacy version ([3adabc4](https://github.com/thi-ng/umbrella/commit/3adabc4))
|
|
199
202
|
|
|
200
|
-
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.7.1...@thi.ng/strings@1.0.0) (2019-01-21)
|
|
203
|
+
# [1.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.7.1...@thi.ng/strings@1.0.0) (2019-01-21)
|
|
201
204
|
|
|
202
|
-
### Build System
|
|
205
|
+
### Build System
|
|
203
206
|
|
|
204
|
-
- update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
|
|
207
|
+
- update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
|
|
205
208
|
|
|
206
|
-
### Features
|
|
209
|
+
### Features
|
|
207
210
|
|
|
208
|
-
- **strings:** add floatFixedWidth(), update float() ([816c9c0](https://github.com/thi-ng/umbrella/commit/816c9c0))
|
|
211
|
+
- **strings:** add floatFixedWidth(), update float() ([816c9c0](https://github.com/thi-ng/umbrella/commit/816c9c0))
|
|
209
212
|
|
|
210
|
-
### BREAKING CHANGES
|
|
213
|
+
### BREAKING CHANGES
|
|
211
214
|
|
|
212
|
-
- enabled multi-outputs (ES6 modules, CJS, UMD)
|
|
213
|
-
- build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
214
|
-
- all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
|
|
215
|
+
- enabled multi-outputs (ES6 modules, CJS, UMD)
|
|
216
|
+
- build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
217
|
+
- all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
|
|
215
218
|
|
|
216
|
-
# [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.6.0...@thi.ng/strings@0.7.0) (2018-12-13)
|
|
219
|
+
# [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.6.0...@thi.ng/strings@0.7.0) (2018-12-13)
|
|
217
220
|
|
|
218
|
-
### Bug Fixes
|
|
221
|
+
### Bug Fixes
|
|
219
222
|
|
|
220
|
-
- **strings:** update kebab() ([1b298f7](https://github.com/thi-ng/umbrella/commit/1b298f7))
|
|
223
|
+
- **strings:** update kebab() ([1b298f7](https://github.com/thi-ng/umbrella/commit/1b298f7))
|
|
221
224
|
|
|
222
|
-
### Features
|
|
225
|
+
### Features
|
|
223
226
|
|
|
224
|
-
- **strings:** add slugify() ([8dcc73a](https://github.com/thi-ng/umbrella/commit/8dcc73a))
|
|
227
|
+
- **strings:** add slugify() ([8dcc73a](https://github.com/thi-ng/umbrella/commit/8dcc73a))
|
|
225
228
|
|
|
226
|
-
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.5.2...@thi.ng/strings@0.6.0) (2018-11-08)
|
|
229
|
+
# [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.5.2...@thi.ng/strings@0.6.0) (2018-11-08)
|
|
227
230
|
|
|
228
|
-
### Features
|
|
231
|
+
### Features
|
|
229
232
|
|
|
230
|
-
- **strings:** add configurable units() HOF & presets ([33e915b](https://github.com/thi-ng/umbrella/commit/33e915b))
|
|
233
|
+
- **strings:** add configurable units() HOF & presets ([33e915b](https://github.com/thi-ng/umbrella/commit/33e915b))
|
|
231
234
|
|
|
232
|
-
# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.3...@thi.ng/strings@0.5.0) (2018-09-25)
|
|
235
|
+
# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.3...@thi.ng/strings@0.5.0) (2018-09-25)
|
|
233
236
|
|
|
234
|
-
### Features
|
|
237
|
+
### Features
|
|
235
238
|
|
|
236
|
-
- **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048))
|
|
239
|
+
- **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048))
|
|
237
240
|
|
|
238
|
-
## [0.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.2...@thi.ng/strings@0.4.3) (2018-09-24)
|
|
241
|
+
## [0.4.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.4.2...@thi.ng/strings@0.4.3) (2018-09-24)
|
|
239
242
|
|
|
240
|
-
### Bug Fixes
|
|
243
|
+
### Bug Fixes
|
|
241
244
|
|
|
242
|
-
- **strings:** rename number parsers ([8cbfb97](https://github.com/thi-ng/umbrella/commit/8cbfb97))
|
|
245
|
+
- **strings:** rename number parsers ([8cbfb97](https://github.com/thi-ng/umbrella/commit/8cbfb97))
|
|
243
246
|
|
|
244
|
-
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.2.0...@thi.ng/strings@0.3.0) (2018-08-24)
|
|
247
|
+
# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.2.0...@thi.ng/strings@0.3.0) (2018-08-24)
|
|
245
248
|
|
|
246
|
-
### Bug Fixes
|
|
249
|
+
### Bug Fixes
|
|
247
250
|
|
|
248
|
-
- **strings:** buffer length (for null inputs) (`center()`) ([5209c42](https://github.com/thi-ng/umbrella/commit/5209c42))
|
|
251
|
+
- **strings:** buffer length (for null inputs) (`center()`) ([5209c42](https://github.com/thi-ng/umbrella/commit/5209c42))
|
|
249
252
|
|
|
250
|
-
### Features
|
|
253
|
+
### Features
|
|
251
254
|
|
|
252
|
-
- **strings:** add case converters ([653a175](https://github.com/thi-ng/umbrella/commit/653a175))
|
|
253
|
-
- **strings:** add truncateLeft() & wrap() stringers ([1a20bc2](https://github.com/thi-ng/umbrella/commit/1a20bc2))
|
|
255
|
+
- **strings:** add case converters ([653a175](https://github.com/thi-ng/umbrella/commit/653a175))
|
|
256
|
+
- **strings:** add truncateLeft() & wrap() stringers ([1a20bc2](https://github.com/thi-ng/umbrella/commit/1a20bc2))
|
|
254
257
|
|
|
255
|
-
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.1.1...@thi.ng/strings@0.2.0) (2018-08-08)
|
|
258
|
+
# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.1.1...@thi.ng/strings@0.2.0) (2018-08-08)
|
|
256
259
|
|
|
257
|
-
### Features
|
|
260
|
+
### Features
|
|
258
261
|
|
|
259
|
-
- **strings:** add opt prefix arg for radix() ([5864f2c](https://github.com/thi-ng/umbrella/commit/5864f2c))
|
|
262
|
+
- **strings:** add opt prefix arg for radix() ([5864f2c](https://github.com/thi-ng/umbrella/commit/5864f2c))
|
|
260
263
|
|
|
261
|
-
## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.1.0...@thi.ng/strings@0.1.1) (2018-08-08)
|
|
264
|
+
## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@0.1.0...@thi.ng/strings@0.1.1) (2018-08-08)
|
|
262
265
|
|
|
263
|
-
### Bug Fixes
|
|
266
|
+
### Bug Fixes
|
|
264
267
|
|
|
265
|
-
- **strings:** float type decl ([b2ebbfc](https://github.com/thi-ng/umbrella/commit/b2ebbfc))
|
|
268
|
+
- **strings:** float type decl ([b2ebbfc](https://github.com/thi-ng/umbrella/commit/b2ebbfc))
|
|
266
269
|
|
|
267
|
-
# 0.1.0 (2018-08-08)
|
|
270
|
+
# 0.1.0 (2018-08-08)
|
|
268
271
|
|
|
269
|
-
### Features
|
|
272
|
+
### Features
|
|
270
273
|
|
|
271
274
|
- **strings:** re-import & update [@thi](https://github.com/thi).ng/strings from MBP2010 ([40781eb](https://github.com/thi-ng/umbrella/commit/40781eb))
|
package/README.md
CHANGED
package/entities.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ENTITIES: Record<string, string>;
|
|
2
|
+
export declare const RE_ENTITIES: RegExp;
|
|
3
|
+
export declare const ENTITIES_REV: Record<string, string>;
|
|
4
|
+
export declare const RE_ENTITIES_REV: RegExp;
|
|
5
|
+
export declare const escapeEntities: (src: string) => string;
|
|
6
|
+
export declare const unescapeEntities: (src: string) => string;
|
|
7
|
+
//# sourceMappingURL=entities.d.ts.map
|
package/entities.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const ENTITIES = {
|
|
2
|
+
"&": "&",
|
|
3
|
+
"<": "<",
|
|
4
|
+
">": ">",
|
|
5
|
+
'"': """,
|
|
6
|
+
"'": "'",
|
|
7
|
+
"—": "—",
|
|
8
|
+
"–": "–",
|
|
9
|
+
"…": "…",
|
|
10
|
+
"¢": "¢",
|
|
11
|
+
"€": "€",
|
|
12
|
+
"£": "£",
|
|
13
|
+
"§": "§",
|
|
14
|
+
"©": "©",
|
|
15
|
+
"®": "®",
|
|
16
|
+
"™": "™",
|
|
17
|
+
"\xa0": " ",
|
|
18
|
+
};
|
|
19
|
+
export const RE_ENTITIES = new RegExp(`[${Object.keys(ENTITIES).join("")}]`, "g");
|
|
20
|
+
export const ENTITIES_REV = Object.entries(ENTITIES).reduce((acc, [k, v]) => ((acc[v] = k), acc), {});
|
|
21
|
+
export const RE_ENTITIES_REV = new RegExp(`(${Object.keys(ENTITIES_REV).join("|")})`, "g");
|
|
22
|
+
const $esc = (re, index) => (src) => src.replace(re, (x) => index[x]);
|
|
23
|
+
export const escapeEntities = $esc(RE_ENTITIES, ENTITIES);
|
|
24
|
+
export const unescapeEntities = $esc(RE_ENTITIES_REV, ENTITIES_REV);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/strings",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Various string formatting & utility functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.0
|
|
38
|
-
"@thi.ng/errors": "^2.0.
|
|
39
|
-
"@thi.ng/hex": "^2.0.
|
|
40
|
-
"@thi.ng/memoize": "^3.0.
|
|
37
|
+
"@thi.ng/api": "^8.2.0",
|
|
38
|
+
"@thi.ng/errors": "^2.0.6",
|
|
39
|
+
"@thi.ng/hex": "^2.0.6",
|
|
40
|
+
"@thi.ng/memoize": "^3.0.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@thi.ng/testament": "^0.1.
|
|
43
|
+
"@thi.ng/testament": "^0.1.6"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"ansi",
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
"./cursor": {
|
|
96
96
|
"import": "./cursor.js"
|
|
97
97
|
},
|
|
98
|
+
"./entities": {
|
|
99
|
+
"import": "./entities.js"
|
|
100
|
+
},
|
|
98
101
|
"./escape": {
|
|
99
102
|
"import": "./escape.js"
|
|
100
103
|
},
|
|
@@ -189,5 +192,5 @@
|
|
|
189
192
|
"thi.ng": {
|
|
190
193
|
"year": 2015
|
|
191
194
|
},
|
|
192
|
-
"gitHead": "
|
|
195
|
+
"gitHead": "5fe52419af63984ebe53032201b2a6174b9cb159"
|
|
193
196
|
}
|
package/units.js
CHANGED
|
@@ -12,7 +12,7 @@ export const units = memoizeJ((exp, base, prec = 2) => {
|
|
|
12
12
|
return `0${base}`;
|
|
13
13
|
}
|
|
14
14
|
const absX = Math.abs(x);
|
|
15
|
-
for (let i = groups.length; --
|
|
15
|
+
for (let i = groups.length; i-- > 0;) {
|
|
16
16
|
const g = groups[i];
|
|
17
17
|
if (absX >= g[0] || i === 0) {
|
|
18
18
|
return (x / g[0]).toFixed(g[1]) + g[2];
|