@thi.ng/strings 2.1.7 → 3.1.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.
- package/CHANGELOG.md +137 -159
- package/README.md +14 -5
- package/case.d.ts +1 -1
- package/center.d.ts +1 -1
- package/center.js +3 -3
- package/entities.d.ts +7 -0
- package/entities.js +24 -0
- package/escape.js +1 -1
- package/float.d.ts +1 -1
- package/float.js +2 -2
- package/groups.js +7 -3
- package/hollerith.d.ts +1 -1
- package/index.d.ts +36 -34
- package/index.js +36 -34
- package/initials.d.ts +22 -0
- package/initials.js +28 -0
- package/int.d.ts +1 -1
- package/int.js +1 -1
- package/interpolate.js +1 -1
- package/join.d.ts +1 -1
- package/join.js +1 -1
- package/package.json +138 -25
- package/pad-left.js +2 -2
- package/pad-right.js +2 -2
- package/percent.d.ts +1 -1
- package/radix.d.ts +1 -1
- package/radix.js +2 -2
- package/repeat.js +1 -1
- package/ruler.js +1 -1
- package/slugify.d.ts +1 -1
- package/splice.js +1 -1
- package/stringify.d.ts +1 -1
- package/tabs.js +1 -1
- package/trim.d.ts +1 -1
- package/trim.js +1 -1
- package/truncate-left.d.ts +1 -1
- package/truncate-left.js +4 -2
- package/truncate.d.ts +1 -1
- package/truncate.js +1 -1
- package/units.d.ts +1 -1
- package/units.js +1 -1
- package/vector.d.ts +1 -1
- package/vector.js +2 -2
- package/word-wrap.d.ts +1 -1
- package/word-wrap.js +9 -3
- package/wrap.d.ts +1 -1
- package/wrap.js +1 -1
- package/lib/index.js +0 -630
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,302 +3,280 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @thi.ng/strings
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [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)
|
|
6
|
+
# [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
7
|
|
|
16
8
|
|
|
17
9
|
### Features
|
|
18
10
|
|
|
19
|
-
* **strings:** add
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# [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)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Features
|
|
29
|
-
|
|
30
|
-
* **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
|
|
31
|
-
* **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
|
|
32
|
-
* **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### BREAKING CHANGES
|
|
36
|
-
|
|
37
|
-
* **strings:** major update wordWrap(), wordWrapLines() etc.
|
|
38
|
-
|
|
39
|
-
- update arguments
|
|
40
|
-
- add `WordWrapOpts` to configure wordwrap behavior
|
|
41
|
-
- add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
|
|
42
|
-
- implement hardwrap mode
|
|
43
|
-
|
|
11
|
+
* **strings:** migrate/add entities, regexes, fns ([57c246d](https://github.com/thi-ng/umbrella/commit/57c246df06279a2e70cfb28ce34ff8d9666b0199))
|
|
44
12
|
|
|
45
13
|
|
|
46
14
|
|
|
47
15
|
|
|
48
|
-
# [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)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Features
|
|
52
|
-
|
|
53
|
-
* **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
|
|
54
|
-
|
|
55
|
-
|
|
56
16
|
|
|
17
|
+
## [3.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.0.2...@thi.ng/strings@3.0.3) (2021-10-15)
|
|
57
18
|
|
|
19
|
+
**Note:** Version bump only for package @thi.ng/strings
|
|
58
20
|
|
|
59
|
-
# [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)
|
|
60
21
|
|
|
61
22
|
|
|
62
|
-
### Features
|
|
63
23
|
|
|
64
|
-
* **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
|
|
65
24
|
|
|
25
|
+
## [3.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@3.0.1...@thi.ng/strings@3.0.2) (2021-10-15)
|
|
66
26
|
|
|
27
|
+
**Note:** Version bump only for package @thi.ng/strings
|
|
67
28
|
|
|
68
29
|
|
|
69
30
|
|
|
70
|
-
# [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)
|
|
71
31
|
|
|
72
32
|
|
|
73
|
-
|
|
33
|
+
## [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)
|
|
74
34
|
|
|
75
|
-
|
|
76
|
-
* **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
|
|
77
|
-
* **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
|
|
78
|
-
* **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
|
|
35
|
+
**Note:** Version bump only for package @thi.ng/strings
|
|
79
36
|
|
|
80
37
|
|
|
81
|
-
### Performance Improvements
|
|
82
38
|
|
|
83
|
-
* **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
|
|
84
39
|
|
|
85
40
|
|
|
41
|
+
# [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)
|
|
86
42
|
|
|
87
43
|
|
|
44
|
+
### Build System
|
|
88
45
|
|
|
89
|
-
|
|
46
|
+
* major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
|
|
90
47
|
|
|
91
48
|
|
|
92
49
|
### Features
|
|
93
50
|
|
|
94
|
-
* **strings:** add
|
|
51
|
+
* **strings:** add initials() ([5b8476f](https://github.com/thi-ng/umbrella/commit/5b8476f28dcfbbc252b11eb68a08f6d47aeca300))
|
|
95
52
|
|
|
96
53
|
|
|
54
|
+
### BREAKING CHANGES
|
|
97
55
|
|
|
56
|
+
* discontinue CommonJS & UMD versions
|
|
98
57
|
|
|
58
|
+
- only ESM modules will be published from now on
|
|
59
|
+
- CJS obsolete due to ESM support in recent versions of node:
|
|
60
|
+
- i.e. launch NodeJS via:
|
|
61
|
+
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
62
|
+
- in the node REPL use `await import(...)` instead of `require()`
|
|
63
|
+
- UMD obsolete due to widespread browser support for ESM
|
|
99
64
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# [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)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Features
|
|
115
|
-
|
|
116
|
-
* **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
|
|
117
|
-
|
|
118
|
-
|
|
65
|
+
Also:
|
|
66
|
+
- normalize/restructure/reorg all package.json files
|
|
67
|
+
- cleanup all build scripts, remove obsolete
|
|
68
|
+
- switch from mocha to @thi.ng/testament for all tests
|
|
119
69
|
|
|
120
70
|
|
|
121
71
|
|
|
122
|
-
# [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)
|
|
123
72
|
|
|
124
73
|
|
|
125
|
-
### Features
|
|
126
74
|
|
|
127
|
-
|
|
128
|
-
* **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
|
|
129
|
-
* **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
|
|
75
|
+
# [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)
|
|
130
76
|
|
|
77
|
+
### Features
|
|
131
78
|
|
|
79
|
+
- **strings:** add ruler(), grid() fns, update readme ([d93cbf9](https://github.com/thi-ng/umbrella/commit/d93cbf9708c414e703fde61e80b5762f34899aa4))
|
|
132
80
|
|
|
81
|
+
# [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)
|
|
133
82
|
|
|
83
|
+
### Features
|
|
134
84
|
|
|
135
|
-
|
|
85
|
+
- **strings:** add ANSI predicates ([928694b](https://github.com/thi-ng/umbrella/commit/928694b0a46a7a58b0b4ab56562afceb0b6c8d8d))
|
|
86
|
+
- **strings:** major update wordWrap() & co. ([9c9c9cc](https://github.com/thi-ng/umbrella/commit/9c9c9cc1abe68ec32edbe91ac5c277561cafd3c4))
|
|
87
|
+
- **strings:** update split() args ([ea503e8](https://github.com/thi-ng/umbrella/commit/ea503e8abdf3598ccd0c1abf5d484164ea73890c))
|
|
136
88
|
|
|
89
|
+
### BREAKING CHANGES
|
|
137
90
|
|
|
138
|
-
|
|
91
|
+
- **strings:** major update wordWrap(), wordWrapLines() etc.
|
|
92
|
+
- update arguments
|
|
93
|
+
- add `WordWrapOpts` to configure wordwrap behavior
|
|
94
|
+
- add `IWordSplit` interface and `SPLIT_PLAIN`, `SPLIT_ANSI` impls
|
|
95
|
+
- implement hardwrap mode
|
|
139
96
|
|
|
140
|
-
|
|
97
|
+
# [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)
|
|
141
98
|
|
|
99
|
+
### Features
|
|
142
100
|
|
|
101
|
+
- **strings:** add int/intLocale, vector formatters ([ac55fe0](https://github.com/thi-ng/umbrella/commit/ac55fe007bed81d04848eddb1c4145eb26cdd437))
|
|
143
102
|
|
|
103
|
+
# [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)
|
|
144
104
|
|
|
105
|
+
### Features
|
|
145
106
|
|
|
146
|
-
|
|
107
|
+
- **strings:** add stringify() HOF ([4ab7e72](https://github.com/thi-ng/umbrella/commit/4ab7e72bf87cbf058a38ca85b5e2853a5f432d9d))
|
|
147
108
|
|
|
109
|
+
# [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)
|
|
148
110
|
|
|
149
|
-
###
|
|
111
|
+
### Features
|
|
150
112
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
113
|
+
- **strings:** add stripAnsi(), lengthAnsi() fns ([86fa81a](https://github.com/thi-ng/umbrella/commit/86fa81acb7dfcf1dc3d6f5600cbf427ee44cf722))
|
|
114
|
+
- **strings:** add tab conversion fns ([aefdd97](https://github.com/thi-ng/umbrella/commit/aefdd97e27fce2405860e817b9c5b4aedb6e59e4))
|
|
115
|
+
- **strings:** add wordWrap*() fns ([2a283c0](https://github.com/thi-ng/umbrella/commit/2a283c018592d8cc76f4ef83b69c6ce3c378aca6))
|
|
116
|
+
- **strings:** update padLeft/Right() args ([118f97f](https://github.com/thi-ng/umbrella/commit/118f97f1fca27671c53d184484a7b435e6eedf88))
|
|
154
117
|
|
|
118
|
+
### Performance Improvements
|
|
155
119
|
|
|
120
|
+
- **strings:** simplify string default delim regexp ([bb62760](https://github.com/thi-ng/umbrella/commit/bb62760f2069a1f7edeaa09ce0e0639047789af3))
|
|
156
121
|
|
|
122
|
+
# [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)
|
|
157
123
|
|
|
124
|
+
### Features
|
|
158
125
|
|
|
159
|
-
|
|
126
|
+
- **strings:** add interpolateKeys() ([bd78d1d](https://github.com/thi-ng/umbrella/commit/bd78d1dba5e467e6cda452e6db6fcd0fb9a3cf19))
|
|
160
127
|
|
|
128
|
+
## [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)
|
|
161
129
|
|
|
162
|
-
###
|
|
130
|
+
### Bug Fixes
|
|
163
131
|
|
|
164
|
-
|
|
132
|
+
- **strings:** update slugifyGH() replacements ([#174](https://github.com/thi-ng/umbrella/issues/174)) ([98a9135](https://github.com/thi-ng/umbrella/commit/98a91351728d730446f9654fc93317c1bece77ed))
|
|
165
133
|
|
|
134
|
+
# [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)
|
|
166
135
|
|
|
136
|
+
### Features
|
|
167
137
|
|
|
138
|
+
- **strings:** add split() iterator ([6d2ec4f](https://github.com/thi-ng/umbrella/commit/6d2ec4fccc688acf5a541ea51c9705faca1c9835))
|
|
168
139
|
|
|
140
|
+
# [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)
|
|
169
141
|
|
|
170
|
-
|
|
142
|
+
### Features
|
|
171
143
|
|
|
144
|
+
- **strings:** add BOM const, update pkg meta ([b6751fc](https://github.com/thi-ng/umbrella/commit/b6751fc506a28a075ea9fee1a5f6d3520449f5af))
|
|
145
|
+
- **strings:** add escape(), update unescape(), add tests ([e0d5f1e](https://github.com/thi-ng/umbrella/commit/e0d5f1edcdf78b075908c4973586a0f1732fe006))
|
|
146
|
+
- **strings:** add unescape() ([924466b](https://github.com/thi-ng/umbrella/commit/924466bc5d5f16ced3da95fa2f24dab2bfad0679))
|
|
172
147
|
|
|
173
|
-
|
|
148
|
+
# [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)
|
|
174
149
|
|
|
175
|
-
|
|
150
|
+
### Features
|
|
176
151
|
|
|
152
|
+
- **strings:** add computeCursorPos() ([c178d00](https://github.com/thi-ng/umbrella/commit/c178d00edcdbe12cec492a1629c80bf359116b66))
|
|
177
153
|
|
|
154
|
+
# [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)
|
|
178
155
|
|
|
156
|
+
### Features
|
|
179
157
|
|
|
158
|
+
- **strings:** add join() HOF ([1c5c46f](https://github.com/thi-ng/umbrella/commit/1c5c46f5ac832865266613a6d71024507238b694))
|
|
159
|
+
- **strings:** add slugifyGH(), refactor slugify() ([1ef805b](https://github.com/thi-ng/umbrella/commit/1ef805be3f0347751eba6da0122e1277a5b81e21))
|
|
160
|
+
- **strings:** add trim() HOF ([350a6c6](https://github.com/thi-ng/umbrella/commit/350a6c6cb010e00f2053fb41eeb0f458ee8fb715))
|
|
180
161
|
|
|
181
|
-
#
|
|
162
|
+
# [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)
|
|
182
163
|
|
|
164
|
+
### Features
|
|
183
165
|
|
|
184
|
-
|
|
166
|
+
- **strings:** add char group LUTs for classification ([c3ff006](https://github.com/thi-ng/umbrella/commit/c3ff006b237bece057f675d62a47d29bab9df413))
|
|
185
167
|
|
|
186
|
-
|
|
168
|
+
# [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)
|
|
187
169
|
|
|
170
|
+
### Features
|
|
188
171
|
|
|
172
|
+
- **strings:** add defFormat() HOF ([62f4e04](https://github.com/thi-ng/umbrella/commit/62f4e04c72e8822930da3f337898dae0ea51f6d0))
|
|
189
173
|
|
|
174
|
+
# [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)
|
|
190
175
|
|
|
176
|
+
### Features
|
|
191
177
|
|
|
192
|
-
|
|
178
|
+
- **strings:** add uuid() formatter ([4592742](https://github.com/thi-ng/umbrella/commit/4592742daad1020aa336e3d819324f4555223160))
|
|
193
179
|
|
|
194
|
-
|
|
180
|
+
# [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)
|
|
195
181
|
|
|
196
|
-
|
|
197
|
-
* **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
|
|
182
|
+
### Features
|
|
198
183
|
|
|
199
|
-
|
|
184
|
+
- **strings:** add format() helpers (str, ignore) ([df87b7c](https://github.com/thi-ng/umbrella/commit/df87b7c7f0a1f9fa5b299fe8311fda02f40ab4cd))
|
|
185
|
+
- **strings:** add interpolate() ([a19e409](https://github.com/thi-ng/umbrella/commit/a19e4094494a8b4af6c35626e4a99394e0481a4e))
|
|
200
186
|
|
|
201
|
-
|
|
187
|
+
# [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)
|
|
202
188
|
|
|
203
|
-
|
|
189
|
+
### Features
|
|
204
190
|
|
|
205
|
-
|
|
191
|
+
- **strings:** add charRange(), add radix & zero-pad presets ([c9e5a63](https://github.com/thi-ng/umbrella/commit/c9e5a63))
|
|
206
192
|
|
|
207
|
-
|
|
193
|
+
# [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)
|
|
208
194
|
|
|
209
|
-
|
|
195
|
+
### Features
|
|
210
196
|
|
|
211
|
-
|
|
197
|
+
- **strings:** enable TS strict compiler flags (refactor) ([76cecb8](https://github.com/thi-ng/umbrella/commit/76cecb8))
|
|
212
198
|
|
|
213
|
-
|
|
199
|
+
# [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)
|
|
214
200
|
|
|
215
|
-
|
|
201
|
+
### Features
|
|
216
202
|
|
|
217
|
-
|
|
203
|
+
- **strings:** add hstr() (hollerith) ([619e9ef](https://github.com/thi-ng/umbrella/commit/619e9ef))
|
|
218
204
|
|
|
219
|
-
|
|
205
|
+
## [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)
|
|
220
206
|
|
|
221
|
-
|
|
207
|
+
### Bug Fixes
|
|
222
208
|
|
|
223
|
-
|
|
209
|
+
- **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))
|
|
224
210
|
|
|
225
|
-
|
|
211
|
+
# [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)
|
|
226
212
|
|
|
227
|
-
|
|
213
|
+
### Build System
|
|
228
214
|
|
|
229
|
-
|
|
215
|
+
- update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
|
|
230
216
|
|
|
231
|
-
|
|
217
|
+
### Features
|
|
232
218
|
|
|
233
|
-
|
|
219
|
+
- **strings:** add floatFixedWidth(), update float() ([816c9c0](https://github.com/thi-ng/umbrella/commit/816c9c0))
|
|
234
220
|
|
|
235
|
-
|
|
221
|
+
### BREAKING CHANGES
|
|
236
222
|
|
|
237
|
-
-
|
|
238
|
-
|
|
239
|
-
- all imports MUST be updated to only refer to package level
|
|
240
|
-
(not individual files anymore). tree shaking in user land will get rid of
|
|
241
|
-
all unused imported symbols.
|
|
223
|
+
- enabled multi-outputs (ES6 modules, CJS, UMD)
|
|
224
|
+
- build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
225
|
+
- 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.
|
|
242
226
|
|
|
243
|
-
#
|
|
227
|
+
# [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)
|
|
244
228
|
|
|
245
|
-
###
|
|
229
|
+
### Bug Fixes
|
|
246
230
|
|
|
247
|
-
|
|
231
|
+
- **strings:** update kebab() ([1b298f7](https://github.com/thi-ng/umbrella/commit/1b298f7))
|
|
248
232
|
|
|
249
|
-
###
|
|
233
|
+
### Features
|
|
250
234
|
|
|
251
|
-
|
|
235
|
+
- **strings:** add slugify() ([8dcc73a](https://github.com/thi-ng/umbrella/commit/8dcc73a))
|
|
252
236
|
|
|
253
|
-
#
|
|
237
|
+
# [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)
|
|
254
238
|
|
|
255
|
-
###
|
|
239
|
+
### Features
|
|
256
240
|
|
|
257
|
-
|
|
241
|
+
- **strings:** add configurable units() HOF & presets ([33e915b](https://github.com/thi-ng/umbrella/commit/33e915b))
|
|
258
242
|
|
|
259
|
-
|
|
260
|
-
# [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)
|
|
243
|
+
# [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)
|
|
261
244
|
|
|
262
|
-
###
|
|
245
|
+
### Features
|
|
263
246
|
|
|
264
|
-
|
|
247
|
+
- **strings:** add splice(), refactor repeat(), add tests ([0cce048](https://github.com/thi-ng/umbrella/commit/0cce048))
|
|
265
248
|
|
|
266
|
-
|
|
267
|
-
## [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)
|
|
249
|
+
## [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)
|
|
268
250
|
|
|
269
|
-
###
|
|
251
|
+
### Bug Fixes
|
|
270
252
|
|
|
271
|
-
|
|
253
|
+
- **strings:** rename number parsers ([8cbfb97](https://github.com/thi-ng/umbrella/commit/8cbfb97))
|
|
272
254
|
|
|
273
|
-
|
|
274
|
-
# [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)
|
|
255
|
+
# [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)
|
|
275
256
|
|
|
276
|
-
###
|
|
257
|
+
### Bug Fixes
|
|
277
258
|
|
|
278
|
-
|
|
259
|
+
- **strings:** buffer length (for null inputs) (`center()`) ([5209c42](https://github.com/thi-ng/umbrella/commit/5209c42))
|
|
279
260
|
|
|
280
|
-
###
|
|
261
|
+
### Features
|
|
281
262
|
|
|
282
|
-
|
|
283
|
-
|
|
263
|
+
- **strings:** add case converters ([653a175](https://github.com/thi-ng/umbrella/commit/653a175))
|
|
264
|
+
- **strings:** add truncateLeft() & wrap() stringers ([1a20bc2](https://github.com/thi-ng/umbrella/commit/1a20bc2))
|
|
284
265
|
|
|
285
|
-
|
|
286
|
-
# [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)
|
|
266
|
+
# [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)
|
|
287
267
|
|
|
288
|
-
###
|
|
268
|
+
### Features
|
|
289
269
|
|
|
290
|
-
|
|
270
|
+
- **strings:** add opt prefix arg for radix() ([5864f2c](https://github.com/thi-ng/umbrella/commit/5864f2c))
|
|
291
271
|
|
|
292
|
-
|
|
293
|
-
## [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)
|
|
272
|
+
## [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)
|
|
294
273
|
|
|
295
|
-
###
|
|
274
|
+
### Bug Fixes
|
|
296
275
|
|
|
297
|
-
|
|
276
|
+
- **strings:** float type decl ([b2ebbfc](https://github.com/thi-ng/umbrella/commit/b2ebbfc))
|
|
298
277
|
|
|
299
|
-
|
|
300
|
-
# 0.1.0 (2018-08-08)
|
|
278
|
+
# 0.1.0 (2018-08-08)
|
|
301
279
|
|
|
302
|
-
###
|
|
280
|
+
### Features
|
|
303
281
|
|
|
304
|
-
|
|
282
|
+
- **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
|
@@ -125,15 +125,24 @@ Partially based on Clojure version of [thi.ng/strf](http://thi.ng/strf).
|
|
|
125
125
|
yarn add @thi.ng/strings
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
ES module import:
|
|
129
|
+
|
|
128
130
|
```html
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
<script type="module" src="https://cdn.skypack.dev/@thi.ng/strings"></script>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
[Skypack documentation](https://docs.skypack.dev/)
|
|
135
|
+
|
|
136
|
+
For Node.js REPL:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
# with flag only for < v16
|
|
140
|
+
node --experimental-repl-await
|
|
131
141
|
|
|
132
|
-
|
|
133
|
-
<script src="https://unpkg.com/@thi.ng/strings/lib/index.umd.js" crossorigin></script>
|
|
142
|
+
> const strings = await import("@thi.ng/strings");
|
|
134
143
|
```
|
|
135
144
|
|
|
136
|
-
Package sizes (gzipped, pre-treeshake): ESM: 4.
|
|
145
|
+
Package sizes (gzipped, pre-treeshake): ESM: 4.38 KB
|
|
137
146
|
|
|
138
147
|
## Dependencies
|
|
139
148
|
|
package/case.d.ts
CHANGED
package/center.d.ts
CHANGED
package/center.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { memoizeJ } from "@thi.ng/memoize";
|
|
2
|
-
import { repeat } from "./repeat";
|
|
3
|
-
import { truncate } from "./truncate";
|
|
1
|
+
import { memoizeJ } from "@thi.ng/memoize/memoizej";
|
|
2
|
+
import { repeat } from "./repeat.js";
|
|
3
|
+
import { truncate } from "./truncate.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returns stringer which pads given input with `ch` (default: space) on
|
|
6
6
|
* both sides and returns fixed width string of given `lineWidth`.
|
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/escape.js
CHANGED
package/float.d.ts
CHANGED
package/float.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { memoizeJ } from "@thi.ng/memoize";
|
|
2
|
-
import { padLeft } from "./pad-left";
|
|
1
|
+
import { memoizeJ } from "@thi.ng/memoize/memoizej";
|
|
2
|
+
import { padLeft } from "./pad-left.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns {@link Stringer} which formats numbers to given precision. If
|
|
5
5
|
* `special` is true, then exceptional handling for:
|
package/groups.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { charRange } from "./range";
|
|
1
|
+
import { charRange } from "./range.js";
|
|
2
2
|
const defGroup = (...xs) => {
|
|
3
3
|
const acc = {};
|
|
4
4
|
for (let range of xs) {
|
|
@@ -43,11 +43,15 @@ export const UPPER = defGroup(charRange("A", "Z"));
|
|
|
43
43
|
/**
|
|
44
44
|
* Combination of {@link UPPER} and {@link LOWER}.
|
|
45
45
|
*/
|
|
46
|
-
export const ALPHA = Object.freeze(
|
|
46
|
+
export const ALPHA = Object.freeze({ ...UPPER, ...LOWER });
|
|
47
47
|
/**
|
|
48
48
|
* Combination of {@link ALPHA} and {@link DIGITS} and '_'.
|
|
49
49
|
*/
|
|
50
|
-
export const ALPHA_NUM = Object.freeze(
|
|
50
|
+
export const ALPHA_NUM = Object.freeze({
|
|
51
|
+
...ALPHA,
|
|
52
|
+
...DIGITS,
|
|
53
|
+
_: true,
|
|
54
|
+
});
|
|
51
55
|
/**
|
|
52
56
|
* Object with ASCII punctuation characters as keys and their values set
|
|
53
57
|
* to true. All others undefined.
|
package/hollerith.d.ts
CHANGED