@clipboard-health/util-ts 2.1.0 → 2.1.1
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/.eslintrc.json +12 -0
- package/jest.config.ts +18 -0
- package/package.json +6 -4
- package/project.json +33 -0
- package/src/{index.d.ts → index.ts} +0 -1
- package/src/lib/{attributes.d.ts → attributes.ts} +1 -1
- package/src/lib/cbh-error.spec.ts +30 -0
- package/src/lib/cbh-error.ts +26 -0
- package/src/lib/cbh-response.spec.ts +25 -0
- package/src/lib/cbh-response.ts +15 -0
- package/src/lib/defined-utils.spec.ts +35 -0
- package/src/lib/{defined-utils.d.ts → defined-utils.ts} +9 -4
- package/src/lib/delay.spec.ts +11 -0
- package/src/lib/delay.ts +5 -0
- package/src/lib/force-cast.spec.ts +8 -0
- package/src/lib/force-cast.ts +4 -0
- package/src/lib/head.spec.ts +21 -0
- package/src/lib/head.ts +5 -0
- package/src/lib/identity.spec.ts +17 -0
- package/src/lib/{identity.d.ts → identity.ts} +3 -2
- package/src/lib/is-string.spec.ts +11 -0
- package/src/lib/is-string.ts +3 -0
- package/src/lib/non-empty-array.ts +7 -0
- package/src/lib/null-to-undefined.spec.ts +33 -0
- package/src/lib/{null-to-undefined.d.ts → null-to-undefined.ts} +4 -2
- package/src/lib/stringify.spec.ts +11 -0
- package/src/lib/stringify.ts +5 -0
- package/src/lib/to-error.spec.ts +28 -0
- package/src/lib/to-error.ts +20 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +8 -0
- package/tsconfig.lint.json +7 -0
- package/tsconfig.spec.json +13 -0
- package/typedoc.json +4 -0
- package/CHANGELOG.md +0 -220
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -17
- package/src/index.js.map +0 -1
- package/src/lib/attributes.d.ts.map +0 -1
- package/src/lib/attributes.js +0 -3
- package/src/lib/attributes.js.map +0 -1
- package/src/lib/cbh-error.d.ts +0 -15
- package/src/lib/cbh-error.d.ts.map +0 -1
- package/src/lib/cbh-error.js +0 -19
- package/src/lib/cbh-error.js.map +0 -1
- package/src/lib/cbh-response.d.ts +0 -18
- package/src/lib/cbh-response.d.ts.map +0 -1
- package/src/lib/cbh-response.js +0 -12
- package/src/lib/cbh-response.js.map +0 -1
- package/src/lib/defined-utils.d.ts.map +0 -1
- package/src/lib/defined-utils.js +0 -21
- package/src/lib/defined-utils.js.map +0 -1
- package/src/lib/delay.d.ts +0 -2
- package/src/lib/delay.d.ts.map +0 -1
- package/src/lib/delay.js +0 -9
- package/src/lib/delay.js.map +0 -1
- package/src/lib/force-cast.d.ts +0 -3
- package/src/lib/force-cast.d.ts.map +0 -1
- package/src/lib/force-cast.js +0 -8
- package/src/lib/force-cast.js.map +0 -1
- package/src/lib/head.d.ts +0 -3
- package/src/lib/head.d.ts.map +0 -1
- package/src/lib/head.js +0 -7
- package/src/lib/head.js.map +0 -1
- package/src/lib/identity.d.ts.map +0 -1
- package/src/lib/identity.js +0 -17
- package/src/lib/identity.js.map +0 -1
- package/src/lib/is-string.d.ts +0 -2
- package/src/lib/is-string.d.ts.map +0 -1
- package/src/lib/is-string.js +0 -7
- package/src/lib/is-string.js.map +0 -1
- package/src/lib/non-empty-array.d.ts +0 -4
- package/src/lib/non-empty-array.d.ts.map +0 -1
- package/src/lib/non-empty-array.js +0 -7
- package/src/lib/non-empty-array.js.map +0 -1
- package/src/lib/null-to-undefined.d.ts.map +0 -1
- package/src/lib/null-to-undefined.js +0 -17
- package/src/lib/null-to-undefined.js.map +0 -1
- package/src/lib/stringify.d.ts +0 -2
- package/src/lib/stringify.d.ts.map +0 -1
- package/src/lib/stringify.js +0 -7
- package/src/lib/stringify.js.map +0 -1
- package/src/lib/to-error.d.ts +0 -4
- package/src/lib/to-error.d.ts.map +0 -1
- package/src/lib/to-error.js +0 -24
- package/src/lib/to-error.js.map +0 -1
package/CHANGELOG.md
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
|
-
|
|
5
|
-
## [2.1.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-2.0.1...util-ts-2.1.0) (2024-07-30)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* add delay ([0603228](https://github.com/ClipboardHealth/cbh-core/commit/0603228e6e1dce079d251d94744cce728db29135))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Bug Fixes
|
|
14
|
-
|
|
15
|
-
* add delay back to background-jobs-mongo ([07a1709](https://github.com/ClipboardHealth/cbh-core/commit/07a1709c76018b7035f38edaa8cf6b43ef1265af))
|
|
16
|
-
|
|
17
|
-
## [2.0.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-2.0.0...util-ts-2.0.1) (2024-07-18)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* add build postTarget ([#692](https://github.com/ClipboardHealth/cbh-core/issues/692)) ([3b42efb](https://github.com/ClipboardHealth/cbh-core/commit/3b42efb603572c7a273c8eedd554773c6a364acf))
|
|
23
|
-
|
|
24
|
-
## [2.0.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.2.1...util-ts-2.0.0) (2024-07-18)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### ⚠ BREAKING CHANGES
|
|
28
|
-
|
|
29
|
-
* upgrade Nx to v18 (#690)
|
|
30
|
-
|
|
31
|
-
### Code Refactoring
|
|
32
|
-
|
|
33
|
-
* upgrade Nx to v18 ([#690](https://github.com/ClipboardHealth/cbh-core/issues/690)) ([e6dd982](https://github.com/ClipboardHealth/cbh-core/commit/e6dd982db39022a72dfbf888f707768bae834ccb))
|
|
34
|
-
|
|
35
|
-
## [1.2.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.2.0...util-ts-1.2.1) (2024-07-12)
|
|
36
|
-
|
|
37
|
-
## [1.2.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.2.0...util-ts-1.2.1) (2024-07-11)
|
|
38
|
-
|
|
39
|
-
## [1.2.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.2.0...util-ts-1.2.1) (2024-07-11)
|
|
40
|
-
|
|
41
|
-
## [1.2.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.2.0...util-ts-1.2.1) (2024-07-11)
|
|
42
|
-
|
|
43
|
-
## [1.2.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.1.0...util-ts-1.2.0) (2024-05-08)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* add more utils ([#624](https://github.com/ClipboardHealth/cbh-core/issues/624)) ([282ec68](https://github.com/ClipboardHealth/cbh-core/commit/282ec68d285ac0007032eb57d5e16177ef380e30))
|
|
49
|
-
|
|
50
|
-
## [1.1.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-1.0.0...util-ts-1.1.0) (2024-01-24)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Features
|
|
54
|
-
|
|
55
|
-
* **money:** add clamp operation ([#515](https://github.com/ClipboardHealth/cbh-core/issues/515)) ([1e92217](https://github.com/ClipboardHealth/cbh-core/commit/1e92217cc5d44762ddaffbe5467398f3b6653744))
|
|
56
|
-
|
|
57
|
-
## [1.0.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.7...util-ts-1.0.0) (2024-01-10)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### ⚠ BREAKING CHANGES
|
|
61
|
-
|
|
62
|
-
* Add 422 response code to CbhError (#497)
|
|
63
|
-
|
|
64
|
-
### Features
|
|
65
|
-
|
|
66
|
-
* Add 422 response code to CbhError ([#497](https://github.com/ClipboardHealth/cbh-core/issues/497)) ([e1695bb](https://github.com/ClipboardHealth/cbh-core/commit/e1695bbcd31ec6db50ac4c07f3d49588999bc436)), closes [4#f184ccb3923a4af4bbb6ee82914a4ff5](https://github.com/ClipboardHealth/4/issues/f184ccb3923a4af4bbb6ee82914a4ff5)
|
|
67
|
-
|
|
68
|
-
## [0.11.7](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.6...util-ts-0.11.7) (2023-12-07)
|
|
69
|
-
|
|
70
|
-
## [0.11.6](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.5...util-ts-0.11.6) (2023-12-07)
|
|
71
|
-
|
|
72
|
-
## [0.11.5](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.4...util-ts-0.11.5) (2023-12-04)
|
|
73
|
-
|
|
74
|
-
## [0.11.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.3...util-ts-0.11.4) (2023-11-06)
|
|
75
|
-
|
|
76
|
-
## [0.11.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.2...util-ts-0.11.3) (2023-11-06)
|
|
77
|
-
|
|
78
|
-
## [0.11.2](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.1...util-ts-0.11.2) (2023-11-06)
|
|
79
|
-
|
|
80
|
-
## [0.11.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.0...util-ts-0.11.1) (2023-09-29)
|
|
81
|
-
|
|
82
|
-
## [0.11.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.10.0...util-ts-0.11.0) (2023-09-24)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### Features
|
|
86
|
-
|
|
87
|
-
* add api-nestjs ([8e6a1bb](https://github.com/ClipboardHealth/cbh-core/commit/8e6a1bbc2cf24d876ae098f4977f96a70a815b5b))
|
|
88
|
-
|
|
89
|
-
## [0.10.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.9.1...util-ts-0.10.0) (2023-09-14)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### Features
|
|
93
|
-
|
|
94
|
-
* add identity function to util-ts ([#314](https://github.com/ClipboardHealth/cbh-core/issues/314)) ([7ba2f98](https://github.com/ClipboardHealth/cbh-core/commit/7ba2f98db8550cef89cd9b1e8631ec6902f46058))
|
|
95
|
-
|
|
96
|
-
## [0.9.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.9.0...util-ts-0.9.1) (2023-08-18)
|
|
97
|
-
|
|
98
|
-
## [0.9.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.8.0...util-ts-0.9.0) (2023-08-14)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
### Features
|
|
102
|
-
|
|
103
|
-
* add typed API relationships, add pagination and API error examples ([#256](https://github.com/ClipboardHealth/cbh-core/issues/256)) ([81377e3](https://github.com/ClipboardHealth/cbh-core/commit/81377e357af447c764ed668196a5c025e35aff35))
|
|
104
|
-
|
|
105
|
-
## [0.8.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.4...util-ts-0.8.0) (2023-08-10)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### Features
|
|
109
|
-
|
|
110
|
-
* add API errors with helpers to create them from CbhError ([#252](https://github.com/ClipboardHealth/cbh-core/issues/252)) ([0efb42a](https://github.com/ClipboardHealth/cbh-core/commit/0efb42a9ef44831bf08b05a6ae19a55cfc38742a))
|
|
111
|
-
|
|
112
|
-
## [0.7.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.3...util-ts-0.7.4) (2023-07-12)
|
|
113
|
-
|
|
114
|
-
## [0.7.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.2...util-ts-0.7.3) (2023-07-10)
|
|
115
|
-
|
|
116
|
-
## [0.7.2](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.1...util-ts-0.7.2) (2023-07-07)
|
|
117
|
-
|
|
118
|
-
## [0.7.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.7.0...util-ts-0.7.1) (2023-07-05)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
### Bug Fixes
|
|
122
|
-
|
|
123
|
-
* export to-error, is-string, and stringify ([#191](https://github.com/ClipboardHealth/cbh-core/issues/191)) ([b89fd79](https://github.com/ClipboardHealth/cbh-core/commit/b89fd79b954c70b4469506ce96982cce9cf40137))
|
|
124
|
-
|
|
125
|
-
## [0.7.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.6.1...util-ts-0.7.0) (2023-07-05)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Features
|
|
129
|
-
|
|
130
|
-
* Add `isDefined` utility function ([#183](https://github.com/ClipboardHealth/cbh-core/issues/183)) ([335e94b](https://github.com/ClipboardHealth/cbh-core/commit/335e94ba37eb969a5c325e012afa86188b3bce59))
|
|
131
|
-
|
|
132
|
-
## [0.6.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.6.0...util-ts-0.6.1) (2023-07-05)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
### Bug Fixes
|
|
136
|
-
|
|
137
|
-
* sonarcloud code smells, reduce duplication ([#182](https://github.com/ClipboardHealth/cbh-core/issues/182)) ([5fd9bb6](https://github.com/ClipboardHealth/cbh-core/commit/5fd9bb6c2f79033ac0adaa8168a24835e24abc8b))
|
|
138
|
-
|
|
139
|
-
## [0.6.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.9...util-ts-0.6.0) (2023-07-05)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
### Features
|
|
143
|
-
|
|
144
|
-
* add toError, toErrorMessage, stringify, and isString to util-ts ([#181](https://github.com/ClipboardHealth/cbh-core/issues/181)) ([149390a](https://github.com/ClipboardHealth/cbh-core/commit/149390ab5e35852accbcf38245eb69e25a1f5323))
|
|
145
|
-
|
|
146
|
-
## [0.5.9](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.8...util-ts-0.5.9) (2023-06-23)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
### Bug Fixes
|
|
150
|
-
|
|
151
|
-
* Prevent NX from modifying package.json ([#158](https://github.com/ClipboardHealth/cbh-core/issues/158)) ([9744a00](https://github.com/ClipboardHealth/cbh-core/commit/9744a0028942aa4cfb61646af9153ab1ef8594a2))
|
|
152
|
-
|
|
153
|
-
## [0.5.8](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.7...util-ts-0.5.8) (2023-06-01)
|
|
154
|
-
|
|
155
|
-
## [0.5.7](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.6...util-ts-0.5.7) (2023-05-25)
|
|
156
|
-
|
|
157
|
-
## [0.5.6](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.5...util-ts-0.5.6) (2023-05-24)
|
|
158
|
-
|
|
159
|
-
## [0.5.5](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.4...util-ts-0.5.5) (2023-05-19)
|
|
160
|
-
|
|
161
|
-
## [0.5.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.3...util-ts-0.5.4) (2023-05-17)
|
|
162
|
-
|
|
163
|
-
## [0.5.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.2...util-ts-0.5.3) (2023-05-16)
|
|
164
|
-
|
|
165
|
-
## [0.5.2](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.1...util-ts-0.5.2) (2023-05-15)
|
|
166
|
-
|
|
167
|
-
## [0.5.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.5.0...util-ts-0.5.1) (2023-05-14)
|
|
168
|
-
|
|
169
|
-
## [0.5.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.4.0...util-ts-0.5.0) (2023-05-09)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### Features
|
|
173
|
-
|
|
174
|
-
* add TypeDoc ([#44](https://github.com/ClipboardHealth/cbh-core/issues/44)) ([fd3d1ba](https://github.com/ClipboardHealth/cbh-core/commit/fd3d1ba8f38ef61a47ff8163bd1b21e034016484))
|
|
175
|
-
|
|
176
|
-
## [0.4.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.3.4...util-ts-0.4.0) (2023-05-09)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
### Features
|
|
180
|
-
|
|
181
|
-
* allow `message-producer` clients to pass arbitrary message attributes ([#43](https://github.com/ClipboardHealth/cbh-core/issues/43)) ([2e94876](https://github.com/ClipboardHealth/cbh-core/commit/2e94876e286da9bcf08b0345bd36316538843178))
|
|
182
|
-
|
|
183
|
-
## [0.3.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.3.3...util-ts-0.3.4) (2023-04-28)
|
|
184
|
-
|
|
185
|
-
## [0.3.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.3.2...util-ts-0.3.3) (2023-04-26)
|
|
186
|
-
|
|
187
|
-
## [0.3.2](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.3.1...util-ts-0.3.2) (2023-04-26)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
### Bug Fixes
|
|
191
|
-
|
|
192
|
-
* allow empty array in ConsumeRequest ([2271707](https://github.com/ClipboardHealth/cbh-core/commit/22717070aa8b3ca7158adf6f26afef0b37212fb6))
|
|
193
|
-
|
|
194
|
-
## [0.3.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.3.0...util-ts-0.3.1) (2023-04-24)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
### Bug Fixes
|
|
198
|
-
|
|
199
|
-
* export types ([565f3a1](https://github.com/ClipboardHealth/cbh-core/commit/565f3a175c96836719a23c5597abec54eeb07362))
|
|
200
|
-
|
|
201
|
-
## [0.3.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.2.0...util-ts-0.3.0) (2023-04-24)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
### Features
|
|
205
|
-
|
|
206
|
-
* use XO ESLint config ([#26](https://github.com/ClipboardHealth/cbh-core/issues/26) ([ae385eb](https://github.com/ClipboardHealth/cbh-core/commit/ae385eb06d02a79f894e2f229731f2cf0aedffbd))
|
|
207
|
-
|
|
208
|
-
## [0.2.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.1.0...util-ts-0.2.0) (2023-04-24)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
### Features
|
|
212
|
-
|
|
213
|
-
* Add `MessageProducer` class ([#24](https://github.com/ClipboardHealth/cbh-core/issues/24)) ([6b9ca48](https://github.com/ClipboardHealth/cbh-core/commit/6b9ca4814a7e4e6e9dd876c3a74dc10f018b023b))
|
|
214
|
-
|
|
215
|
-
## 0.1.0 (2023-04-19)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
### Features
|
|
219
|
-
|
|
220
|
-
* **DEV-19:** implement `crypto-kms` lib ([#22](https://github.com/ClipboardHealth/cbh-core/issues/22)) ([79a19d3](https://github.com/ClipboardHealth/cbh-core/commit/79a19d30b340b39e792cb5bb7ee01fe178d6bd27))
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
package/src/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./lib/attributes"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/cbh-error"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/cbh-response"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./lib/defined-utils"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./lib/delay"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./lib/force-cast"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./lib/head"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./lib/identity"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./lib/is-string"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./lib/non-empty-array"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./lib/null-to-undefined"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./lib/stringify"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./lib/to-error"), exports);
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,0DAAgC;AAChC,6DAAmC;AACnC,8DAAoC;AACpC,sDAA4B;AAC5B,2DAAiC;AACjC,qDAA2B;AAC3B,yDAA+B;AAC/B,0DAAgC;AAChC,gEAAsC;AACtC,kEAAwC;AACxC,0DAAgC;AAChC,yDAA+B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/attributes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
|
package/src/lib/attributes.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/attributes.ts"],"names":[],"mappings":""}
|
package/src/lib/cbh-error.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type OneOrNonEmptyArray } from "./non-empty-array";
|
|
2
|
-
declare const ERROR_STATUS_CODES: readonly [400, 401, 403, 404, 409, 422, 429, 500];
|
|
3
|
-
export type ErrorStatusCode = (typeof ERROR_STATUS_CODES)[number];
|
|
4
|
-
export interface CbhIssue {
|
|
5
|
-
cause?: Error;
|
|
6
|
-
id?: string;
|
|
7
|
-
message: string;
|
|
8
|
-
statusCode?: ErrorStatusCode;
|
|
9
|
-
}
|
|
10
|
-
export declare class CbhError extends Error {
|
|
11
|
-
readonly issues: CbhIssue[];
|
|
12
|
-
constructor(issues: OneOrNonEmptyArray<CbhIssue>);
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=cbh-error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-error.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAE7E,QAAA,MAAM,kBAAkB,mDAAoD,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,MAAM,EAAE,QAAQ,EAAE,CAAC;gBAEvB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC;CAUjD"}
|
package/src/lib/cbh-error.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CbhError = void 0;
|
|
4
|
-
const non_empty_array_1 = require("./non-empty-array");
|
|
5
|
-
const ERROR_STATUS_CODES = [400, 401, 403, 404, 409, 422, 429, 500];
|
|
6
|
-
class CbhError extends Error {
|
|
7
|
-
issues;
|
|
8
|
-
constructor(issues) {
|
|
9
|
-
const is = (0, non_empty_array_1.toNonEmptyArray)(issues);
|
|
10
|
-
const first = is[0];
|
|
11
|
-
super(first?.message, { cause: first?.cause });
|
|
12
|
-
// See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#example
|
|
13
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
14
|
-
this.issues = is;
|
|
15
|
-
this.name = "CbhError";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.CbhError = CbhError;
|
|
19
|
-
//# sourceMappingURL=cbh-error.js.map
|
package/src/lib/cbh-error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-error.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-error.ts"],"names":[],"mappings":";;;AAAA,uDAA6E;AAE7E,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAU7E,MAAa,QAAS,SAAQ,KAAK;IACjB,MAAM,CAAa;IAEnC,YAAY,MAAoC;QAC9C,MAAM,EAAE,GAAG,IAAA,iCAAe,EAAC,MAAM,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACpB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/C,6FAA6F;QAC7F,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAbD,4BAaC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CbhError, type CbhIssue } from "./cbh-error";
|
|
2
|
-
import type { OneOrNonEmptyArray } from "./non-empty-array";
|
|
3
|
-
export type CbhResponse<T> = {
|
|
4
|
-
success: true;
|
|
5
|
-
data: T;
|
|
6
|
-
} | {
|
|
7
|
-
success: false;
|
|
8
|
-
error: CbhError;
|
|
9
|
-
};
|
|
10
|
-
export declare function toErrorCbhResponse(issues: OneOrNonEmptyArray<CbhIssue>): {
|
|
11
|
-
success: false;
|
|
12
|
-
error: CbhError;
|
|
13
|
-
};
|
|
14
|
-
export declare function toSuccessCbhResponse<T>(data: T): {
|
|
15
|
-
success: true;
|
|
16
|
-
data: T;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=cbh-response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-response.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE9F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACxE,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,QAAQ,CAAC;CACjB,CAEA;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAE3E"}
|
package/src/lib/cbh-response.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toErrorCbhResponse = toErrorCbhResponse;
|
|
4
|
-
exports.toSuccessCbhResponse = toSuccessCbhResponse;
|
|
5
|
-
const cbh_error_1 = require("./cbh-error");
|
|
6
|
-
function toErrorCbhResponse(issues) {
|
|
7
|
-
return { success: false, error: new cbh_error_1.CbhError(issues) };
|
|
8
|
-
}
|
|
9
|
-
function toSuccessCbhResponse(data) {
|
|
10
|
-
return { success: true, data };
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=cbh-response.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cbh-response.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/cbh-response.ts"],"names":[],"mappings":";;AAKA,gDAKC;AAED,oDAEC;AAdD,2CAAsD;AAKtD,SAAgB,kBAAkB,CAAC,MAAoC;IAIrE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,oBAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,SAAgB,oBAAoB,CAAI,IAAO;IAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defined-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/defined-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,eAAe,GAAG,KAAK,IAAI,eAAe,CAEzF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,eAAe,GAAG,KAAK,IAAI,CAAC,CAEnE"}
|
package/src/lib/defined-utils.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNullOrUndefined = isNullOrUndefined;
|
|
4
|
-
exports.isDefined = isDefined;
|
|
5
|
-
/**
|
|
6
|
-
* Checks whether a value is null or undefined. If it is not defined, the return type ensures type safety.
|
|
7
|
-
* @param value any value or null or undefined
|
|
8
|
-
* @returns true if `value` is null or undefined, false otherwise.
|
|
9
|
-
*/
|
|
10
|
-
function isNullOrUndefined(value) {
|
|
11
|
-
return value === null || value === undefined;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Checks whether a value is defined. If it is defined, the return type ensures type safety.
|
|
15
|
-
* @param value any value or null or undefined
|
|
16
|
-
* @returns true if `value` is defined (not null and not undefined), false otherwise.
|
|
17
|
-
*/
|
|
18
|
-
function isDefined(value) {
|
|
19
|
-
return !isNullOrUndefined(value);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=defined-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defined-utils.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/defined-utils.ts"],"names":[],"mappings":";;AAYA,8CAEC;AAOD,8BAEC;AAhBD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAI,KAA0B;IAC7D,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAI,KAA0B;IACrD,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/src/lib/delay.d.ts
DELETED
package/src/lib/delay.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/delay.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D"}
|
package/src/lib/delay.js
DELETED
package/src/lib/delay.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/delay.ts"],"names":[],"mappings":";;AAAA,sBAIC;AAJM,KAAK,UAAU,KAAK,CAAC,YAAoB;IAC9C,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC5B,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/src/lib/force-cast.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"force-cast.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/force-cast.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAE9C"}
|
package/src/lib/force-cast.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"force-cast.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/force-cast.ts"],"names":[],"mappings":";;AACA,8BAEC;AAHD,uCAAuC;AACvC,SAAgB,SAAS,CAAI,KAAc;IACzC,OAAO,KAAU,CAAC;AACpB,CAAC"}
|
package/src/lib/head.d.ts
DELETED
package/src/lib/head.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/head.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAEpC,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAE5D"}
|
package/src/lib/head.js
DELETED
package/src/lib/head.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"head.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/head.ts"],"names":[],"mappings":";;AAEA,oBAEC;AAFD,SAAgB,IAAI,CAAI,KAAqB;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEvC"}
|
package/src/lib/identity.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.identity = identity;
|
|
4
|
-
/**
|
|
5
|
-
* A generic function that returns its input unchanged.
|
|
6
|
-
* This function is useful in various functional programming scenarios, such as:
|
|
7
|
-
* - Creating higher-order functions like map, filter, and reduce.
|
|
8
|
-
* - Composing functions by providing an "identity element" in function composition.
|
|
9
|
-
*
|
|
10
|
-
* @template T - The type of the input value.
|
|
11
|
-
* @param {T} value - The value to return unchanged.
|
|
12
|
-
* @returns {T} The input value, unchanged.
|
|
13
|
-
*/
|
|
14
|
-
function identity(value) {
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=identity.js.map
|
package/src/lib/identity.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/identity.ts"],"names":[],"mappings":";;AAUA,4BAEC;AAZD;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAI,KAAQ;IAClC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/src/lib/is-string.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-string.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/is-string.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|
package/src/lib/is-string.js
DELETED
package/src/lib/is-string.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-string.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/is-string.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAFD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,CAAC;AAC9D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-empty-array.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/non-empty-array.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAE3C,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAEzD,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAEjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-empty-array.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/non-empty-array.ts"],"names":[],"mappings":";;AAIA,0CAEC;AAFD,SAAgB,eAAe,CAAI,KAA4B;IAC7D,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"null-to-undefined.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAsB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAE7F"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nullToUndefined = nullToUndefined;
|
|
4
|
-
/**
|
|
5
|
-
* Turns a null-returning promise into a promise returning undefined.
|
|
6
|
-
*
|
|
7
|
-
* Some of the database packages that we use return promises (Prisma)
|
|
8
|
-
* or promise-like objects (mongoose) that can resolve to null.
|
|
9
|
-
* This function is useful for getting rid of nulls which are banned by our linter rules.
|
|
10
|
-
*
|
|
11
|
-
* @param value A promise or a promise-like object.
|
|
12
|
-
*/
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
14
|
-
async function nullToUndefined(value) {
|
|
15
|
-
return (await value) ?? undefined;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=null-to-undefined.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"null-to-undefined.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/null-to-undefined.ts"],"names":[],"mappings":";;AAUA,0CAEC;AAZD;;;;;;;;GAQG;AACH,wDAAwD;AACjD,KAAK,UAAU,eAAe,CAAI,KAA4B;IACnE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC;AACpC,CAAC"}
|
package/src/lib/stringify.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/stringify.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIhD"}
|
package/src/lib/stringify.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringify = stringify;
|
|
4
|
-
function stringify(value) {
|
|
5
|
-
return JSON.stringify(value, (_, value) => typeof value === "bigint" ? String(value) : value);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=stringify.js.map
|
package/src/lib/stringify.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/stringify.ts"],"names":[],"mappings":";;AAAA,8BAIC;AAJD,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,KAAc,EAAE,EAAE,CACjD,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAClD,CAAC;AACJ,CAAC"}
|
package/src/lib/to-error.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"to-error.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/to-error.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAQ7C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAErD"}
|
package/src/lib/to-error.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isError = isError;
|
|
4
|
-
exports.toError = toError;
|
|
5
|
-
exports.toErrorMessage = toErrorMessage;
|
|
6
|
-
const is_string_1 = require("./is-string");
|
|
7
|
-
const stringify_1 = require("./stringify");
|
|
8
|
-
function isError(error) {
|
|
9
|
-
return error instanceof Error;
|
|
10
|
-
}
|
|
11
|
-
function toError(error) {
|
|
12
|
-
if (isError(error))
|
|
13
|
-
return error;
|
|
14
|
-
try {
|
|
15
|
-
return new Error((0, is_string_1.isString)(error) ? error : (0, stringify_1.stringify)(error));
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return new Error(String(error));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function toErrorMessage(error) {
|
|
22
|
-
return toError(error).message;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=to-error.js.map
|
package/src/lib/to-error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"to-error.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/to-error.ts"],"names":[],"mappings":";;AAGA,0BAEC;AAED,0BAQC;AAED,wCAEC;AAnBD,2CAAuC;AACvC,2CAAwC;AAExC,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,CAAC;AAChC,CAAC;AAED,SAAgB,OAAO,CAAC,KAAc;IACpC,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjC,IAAI,CAAC;QACH,OAAO,IAAI,KAAK,CAAC,IAAA,oBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAChC,CAAC"}
|