@thi.ng/strings 3.0.1 → 3.1.3

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 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.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.0.0...@thi.ng/strings@3.0.1) (2021-10-13)
6
+ ## [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)
7
7
 
8
8
  **Note:** Version bump only for package @thi.ng/strings
9
9
 
@@ -11,6 +11,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
+ # [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)
15
+
16
+
17
+ ### Features
18
+
19
+ * **strings:** migrate/add entities, regexes, fns ([57c246d](https://github.com/thi-ng/umbrella/commit/57c246df06279a2e70cfb28ce34ff8d9666b0199))
20
+
21
+
22
+
23
+
24
+
14
25
  # [3.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@2.1.7...@thi.ng/strings@3.0.0) (2021-10-12)
15
26
 
16
27
 
@@ -45,211 +56,211 @@ Also:
45
56
 
46
57
 
47
58
 
48
- # [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)
59
+ # [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)
49
60
 
50
- ### Features
61
+ ### Features
51
62
 
52
- - **strings:** add ruler(), grid() fns, update readme ([d93cbf9](https://github.com/thi-ng/umbrella/commit/d93cbf9708c414e703fde61e80b5762f34899aa4))
63
+ - **strings:** add ruler(), grid() fns, update readme ([d93cbf9](https://github.com/thi-ng/umbrella/commit/d93cbf9708c414e703fde61e80b5762f34899aa4))
53
64
 
54
- # [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)
65
+ # [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)
55
66
 
56
- ### Features
67
+ ### Features
57
68
 
58
- - **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
59
- - **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
60
- - **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
69
+ - **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
70
+ - **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
71
+ - **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
61
72
 
62
- ### BREAKING CHANGES
73
+ ### BREAKING CHANGES
63
74
 
64
- - **strings:** major update wordWrap(), wordWrapLines() etc.
65
- - update arguments
66
- - add `WordWrapOpts` to configure wordwrap behavior
67
- - add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
68
- - implement hardwrap mode
75
+ - **strings:** major update wordWrap(), wordWrapLines() etc.
76
+ - update arguments
77
+ - add `WordWrapOpts` to configure wordwrap behavior
78
+ - add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
79
+ - implement hardwrap mode
69
80
 
70
- # [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)
81
+ # [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)
71
82
 
72
- ### Features
83
+ ### Features
73
84
 
74
- - **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
85
+ - **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
75
86
 
76
- # [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)
87
+ # [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)
77
88
 
78
- ### Features
89
+ ### Features
79
90
 
80
- - **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
91
+ - **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
81
92
 
82
- # [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)
93
+ # [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)
83
94
 
84
- ### Features
95
+ ### Features
85
96
 
86
- - **strings:** add stripAnsi(), lengthAnsi() fns ([86fa81a](https://github.com/thi-ng/umbrella/commit/86fa81acb7dfcf1dc3d6f5600cbf427ee44cf722))
87
- - **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
88
- - **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
89
- - **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
97
+ - **strings:** add stripAnsi(), lengthAnsi() fns ([86fa81a](https://github.com/thi-ng/umbrella/commit/86fa81acb7dfcf1dc3d6f5600cbf427ee44cf722))
98
+ - **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
99
+ - **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
100
+ - **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
90
101
 
91
- ### Performance Improvements
102
+ ### Performance Improvements
92
103
 
93
- - **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
104
+ - **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
94
105
 
95
- # [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)
106
+ # [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)
96
107
 
97
- ### Features
108
+ ### Features
98
109
 
99
- - **strings:** add interpolateKeys() ([bd78d1d](https://github.com/thi-ng/umbrella/commit/bd78d1dba5e467e6cda452e6db6fcd0fb9a3cf19))
110
+ - **strings:** add interpolateKeys() ([bd78d1d](https://github.com/thi-ng/umbrella/commit/bd78d1dba5e467e6cda452e6db6fcd0fb9a3cf19))
100
111
 
101
- ## [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)
112
+ ## [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)
102
113
 
103
- ### Bug Fixes
114
+ ### Bug Fixes
104
115
 
105
- - **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
116
+ - **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
106
117
 
107
- # [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)
118
+ # [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)
108
119
 
109
- ### Features
120
+ ### Features
110
121
 
111
- - **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
122
+ - **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
112
123
 
113
- # [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)
124
+ # [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)
114
125
 
115
- ### Features
126
+ ### Features
116
127
 
117
- - **strings:** add BOM const, update pkg meta ([b6751fc](https://github.com/thi-ng/umbrella/commit/b6751fc506a28a075ea9fee1a5f6d3520449f5af))
118
- - **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
119
- - **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
128
+ - **strings:** add BOM const, update pkg meta ([b6751fc](https://github.com/thi-ng/umbrella/commit/b6751fc506a28a075ea9fee1a5f6d3520449f5af))
129
+ - **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
130
+ - **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
120
131
 
121
- # [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)
132
+ # [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)
122
133
 
123
- ### Features
134
+ ### Features
124
135
 
125
- - **strings:** add computeCursorPos() ([c178d00](https://github.com/thi-ng/umbrella/commit/c178d00edcdbe12cec492a1629c80bf359116b66))
136
+ - **strings:** add computeCursorPos() ([c178d00](https://github.com/thi-ng/umbrella/commit/c178d00edcdbe12cec492a1629c80bf359116b66))
126
137
 
127
- # [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)
138
+ # [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)
128
139
 
129
- ### Features
140
+ ### Features
130
141
 
131
- - **strings:** add join() HOF ([1c5c46f](https://github.com/thi-ng/umbrella/commit/1c5c46f5ac832865266613a6d71024507238b694))
132
- - **strings:** add slugifyGH(), refactor slugify() ([1ef805b](https://github.com/thi-ng/umbrella/commit/1ef805be3f0347751eba6da0122e1277a5b81e21))
133
- - **strings:** add trim() HOF ([350a6c6](https://github.com/thi-ng/umbrella/commit/350a6c6cb010e00f2053fb41eeb0f458ee8fb715))
142
+ - **strings:** add join() HOF ([1c5c46f](https://github.com/thi-ng/umbrella/commit/1c5c46f5ac832865266613a6d71024507238b694))
143
+ - **strings:** add slugifyGH(), refactor slugify() ([1ef805b](https://github.com/thi-ng/umbrella/commit/1ef805be3f0347751eba6da0122e1277a5b81e21))
144
+ - **strings:** add trim() HOF ([350a6c6](https://github.com/thi-ng/umbrella/commit/350a6c6cb010e00f2053fb41eeb0f458ee8fb715))
134
145
 
135
- # [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)
146
+ # [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)
136
147
 
137
- ### Features
148
+ ### Features
138
149
 
139
- - **strings:** add char group LUTs for classification ([c3ff006](https://github.com/thi-ng/umbrella/commit/c3ff006b237bece057f675d62a47d29bab9df413))
150
+ - **strings:** add char group LUTs for classification ([c3ff006](https://github.com/thi-ng/umbrella/commit/c3ff006b237bece057f675d62a47d29bab9df413))
140
151
 
141
- # [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)
152
+ # [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)
142
153
 
143
- ### Features
154
+ ### Features
144
155
 
145
- - **strings:** add defFormat() HOF ([62f4e04](https://github.com/thi-ng/umbrella/commit/62f4e04c72e8822930da3f337898dae0ea51f6d0))
156
+ - **strings:** add defFormat() HOF ([62f4e04](https://github.com/thi-ng/umbrella/commit/62f4e04c72e8822930da3f337898dae0ea51f6d0))
146
157
 
147
- # [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)
158
+ # [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)
148
159
 
149
- ### Features
160
+ ### Features
150
161
 
151
- - **strings:** add uuid() formatter ([4592742](https://github.com/thi-ng/umbrella/commit/4592742daad1020aa336e3d819324f4555223160))
162
+ - **strings:** add uuid() formatter ([4592742](https://github.com/thi-ng/umbrella/commit/4592742daad1020aa336e3d819324f4555223160))
152
163
 
153
- # [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)
164
+ # [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)
154
165
 
155
- ### Features
166
+ ### Features
156
167
 
157
- - **strings:** add format() helpers (str, ignore) ([df87b7c](https://github.com/thi-ng/umbrella/commit/df87b7c7f0a1f9fa5b299fe8311fda02f40ab4cd))
158
- - **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
168
+ - **strings:** add format() helpers (str, ignore) ([df87b7c](https://github.com/thi-ng/umbrella/commit/df87b7c7f0a1f9fa5b299fe8311fda02f40ab4cd))
169
+ - **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
159
170
 
160
- # [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)
171
+ # [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)
161
172
 
162
- ### Features
173
+ ### Features
163
174
 
164
- - **strings:** add charRange(), add radix & zero-pad presets ([c9e5a63](https://github.com/thi-ng/umbrella/commit/c9e5a63))
175
+ - **strings:** add charRange(), add radix & zero-pad presets ([c9e5a63](https://github.com/thi-ng/umbrella/commit/c9e5a63))
165
176
 
166
- # [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)
177
+ # [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)
167
178
 
168
- ### Features
179
+ ### Features
169
180
 
170
- - **strings:** enable TS strict compiler flags (refactor) ([76cecb8](https://github.com/thi-ng/umbrella/commit/76cecb8))
181
+ - **strings:** enable TS strict compiler flags (refactor) ([76cecb8](https://github.com/thi-ng/umbrella/commit/76cecb8))
171
182
 
172
- # [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)
183
+ # [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)
173
184
 
174
- ### Features
185
+ ### Features
175
186
 
176
- - **strings:** add hstr() (hollerith) ([619e9ef](https://github.com/thi-ng/umbrella/commit/619e9ef))
187
+ - **strings:** add hstr() (hollerith) ([619e9ef](https://github.com/thi-ng/umbrella/commit/619e9ef))
177
188
 
178
- ## [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)
189
+ ## [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)
179
190
 
180
- ### Bug Fixes
191
+ ### Bug Fixes
181
192
 
182
- - **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))
193
+ - **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))
183
194
 
184
- # [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)
195
+ # [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)
185
196
 
186
- ### Build System
197
+ ### Build System
187
198
 
188
- - update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
199
+ - update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
189
200
 
190
- ### Features
201
+ ### Features
191
202
 
192
- - **strings:** add floatFixedWidth(), update float() ([816c9c0](https://github.com/thi-ng/umbrella/commit/816c9c0))
203
+ - **strings:** add floatFixedWidth(), update float() ([816c9c0](https://github.com/thi-ng/umbrella/commit/816c9c0))
193
204
 
194
- ### BREAKING CHANGES
205
+ ### BREAKING CHANGES
195
206
 
196
- - enabled multi-outputs (ES6 modules, CJS, UMD)
197
- - build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
198
- - 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.
207
+ - enabled multi-outputs (ES6 modules, CJS, UMD)
208
+ - build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
209
+ - 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.
199
210
 
200
- # [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)
211
+ # [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)
201
212
 
202
- ### Bug Fixes
213
+ ### Bug Fixes
203
214
 
204
- - **strings:** update kebab() ([1b298f7](https://github.com/thi-ng/umbrella/commit/1b298f7))
215
+ - **strings:** update kebab() ([1b298f7](https://github.com/thi-ng/umbrella/commit/1b298f7))
205
216
 
206
- ### Features
217
+ ### Features
207
218
 
208
- - **strings:** add slugify() ([8dcc73a](https://github.com/thi-ng/umbrella/commit/8dcc73a))
219
+ - **strings:** add slugify() ([8dcc73a](https://github.com/thi-ng/umbrella/commit/8dcc73a))
209
220
 
210
- # [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)
221
+ # [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)
211
222
 
212
- ### Features
223
+ ### Features
213
224
 
214
- - **strings:** add configurable units() HOF & presets ([33e915b](https://github.com/thi-ng/umbrella/commit/33e915b))
225
+ - **strings:** add configurable units() HOF & presets ([33e915b](https://github.com/thi-ng/umbrella/commit/33e915b))
215
226
 
216
- # [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)
227
+ # [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)
217
228
 
218
- ### Features
229
+ ### Features
219
230
 
220
- - **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048))
231
+ - **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048))
221
232
 
222
- ## [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)
233
+ ## [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)
223
234
 
224
- ### Bug Fixes
235
+ ### Bug Fixes
225
236
 
226
- - **strings:** rename number parsers ([8cbfb97](https://github.com/thi-ng/umbrella/commit/8cbfb97))
237
+ - **strings:** rename number parsers ([8cbfb97](https://github.com/thi-ng/umbrella/commit/8cbfb97))
227
238
 
228
- # [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)
239
+ # [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)
229
240
 
230
- ### Bug Fixes
241
+ ### Bug Fixes
231
242
 
232
- - **strings:** buffer length (for null inputs) (`center()`) ([5209c42](https://github.com/thi-ng/umbrella/commit/5209c42))
243
+ - **strings:** buffer length (for null inputs) (`center()`) ([5209c42](https://github.com/thi-ng/umbrella/commit/5209c42))
233
244
 
234
- ### Features
245
+ ### Features
235
246
 
236
- - **strings:** add case converters ([653a175](https://github.com/thi-ng/umbrella/commit/653a175))
237
- - **strings:** add truncateLeft() & wrap() stringers ([1a20bc2](https://github.com/thi-ng/umbrella/commit/1a20bc2))
247
+ - **strings:** add case converters ([653a175](https://github.com/thi-ng/umbrella/commit/653a175))
248
+ - **strings:** add truncateLeft() & wrap() stringers ([1a20bc2](https://github.com/thi-ng/umbrella/commit/1a20bc2))
238
249
 
239
- # [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)
250
+ # [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)
240
251
 
241
- ### Features
252
+ ### Features
242
253
 
243
- - **strings:** add opt prefix arg for radix() ([5864f2c](https://github.com/thi-ng/umbrella/commit/5864f2c))
254
+ - **strings:** add opt prefix arg for radix() ([5864f2c](https://github.com/thi-ng/umbrella/commit/5864f2c))
244
255
 
245
- ## [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)
256
+ ## [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)
246
257
 
247
- ### Bug Fixes
258
+ ### Bug Fixes
248
259
 
249
- - **strings:** float type decl ([b2ebbfc](https://github.com/thi-ng/umbrella/commit/b2ebbfc))
260
+ - **strings:** float type decl ([b2ebbfc](https://github.com/thi-ng/umbrella/commit/b2ebbfc))
250
261
 
251
- # 0.1.0 (2018-08-08)
262
+ # 0.1.0 (2018-08-08)
252
263
 
253
- ### Features
264
+ ### Features
254
265
 
255
266
  - **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
@@ -142,7 +142,7 @@ node --experimental-repl-await
142
142
  > const strings = await import("@thi.ng/strings");
143
143
  ```
144
144
 
145
- Package sizes (gzipped, pre-treeshake): ESM: 4.12 KB
145
+ Package sizes (gzipped, pre-treeshake): ESM: 4.38 KB
146
146
 
147
147
  ## Dependencies
148
148
 
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
+ "&": "&amp;",
3
+ "<": "&lt;",
4
+ ">": "&gt;",
5
+ '"': "&quot;",
6
+ "'": "&apos;",
7
+ "—": "&mdash;",
8
+ "–": "&ndash;",
9
+ "…": "&hellip;",
10
+ "¢": "&cent;",
11
+ "€": "&euro;",
12
+ "£": "&pound;",
13
+ "§": "&sect;",
14
+ "©": "&copy;",
15
+ "®": "&reg;",
16
+ "™": "&trade;",
17
+ "\xa0": "&nbsp;",
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
@@ -3,6 +3,7 @@ export * from "./ansi.js";
3
3
  export * from "./case.js";
4
4
  export * from "./center.js";
5
5
  export * from "./cursor.js";
6
+ export * from "./entities.js";
6
7
  export * from "./escape.js";
7
8
  export * from "./float.js";
8
9
  export * from "./format.js";
package/index.js CHANGED
@@ -3,6 +3,7 @@ export * from "./ansi.js";
3
3
  export * from "./case.js";
4
4
  export * from "./center.js";
5
5
  export * from "./cursor.js";
6
+ export * from "./entities.js";
6
7
  export * from "./escape.js";
7
8
  export * from "./float.js";
8
9
  export * from "./format.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/strings",
3
- "version": "3.0.1",
3
+ "version": "3.1.3",
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.1",
38
- "@thi.ng/errors": "^2.0.1",
39
- "@thi.ng/hex": "^2.0.1",
40
- "@thi.ng/memoize": "^3.0.1"
37
+ "@thi.ng/api": "^8.1.0",
38
+ "@thi.ng/errors": "^2.0.6",
39
+ "@thi.ng/hex": "^2.0.6",
40
+ "@thi.ng/memoize": "^3.0.7"
41
41
  },
42
42
  "devDependencies": {
43
- "@thi.ng/testament": "^0.1.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": "2e6b3d7c0f4c5686c1e9bdb4902ed7d3f90bcc19"
195
+ "gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
193
196
  }
package/word-wrap.js CHANGED
@@ -8,9 +8,9 @@ import { split } from "./split.js";
8
8
  * @internal
9
9
  */
10
10
  class Line {
11
- n = 0;
12
- w = [];
13
11
  constructor(word, n) {
12
+ this.n = 0;
13
+ this.w = [];
14
14
  word != null && this.add(word, n);
15
15
  }
16
16
  add(word, n = word.length) {