@rsdk/common 4.0.0-next.14 → 4.0.0-next.15
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 +34 -14
- package/dist/convert/convert.class.js.map +1 -1
- package/dist/functions/obj-normalization.js.map +1 -1
- package/dist/observable/observable-to-async-iterable.js +24 -6
- package/dist/observable/observable-to-async-iterable.js.map +1 -1
- package/dist/size/size.class.js.map +1 -1
- package/dist/strings/get-random-bytes.js.map +1 -1
- package/dist/strings/text.fn.js.map +1 -1
- package/dist/time/repeat.fn.js.map +1 -1
- package/dist/time/stopwatch.class.js.map +1 -1
- package/dist/time/timespan.class.js.map +1 -1
- package/dist/types/assert.class.js.map +1 -1
- package/dist/types/error-like.type.js.map +1 -1
- package/jest.config.e2e.js +1 -0
- package/jest.config.js +1 -5
- package/jest.config.unit.js +1 -0
- package/package.json +2 -2
- package/src/convert/convert.spec.ts +367 -61
- package/src/functions/misc.spec.ts +44 -29
- package/src/functions/obj-normalization.spec.ts +11 -1
- package/src/observable/observable-to-async-iterable.ts +24 -6
- package/src/size/size.spec.ts +1 -1
- package/src/types/deep-partial.type.ts +10 -10
- package/src/types/error-like.type.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## [4.0.0-next.15](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.14...v4.0.0-next.15) (2023-11-30)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added protocol detector ([#166](https://github.com/R-Vision/rsdk/issues/166)) ([f348995](https://github.com/R-Vision/rsdk/commit/f348995f29648c7392b7375c5b2001197d60eb36))
|
|
11
|
+
|
|
6
12
|
## [4.0.0-next.14](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.13...v4.0.0-next.14) (2023-11-29)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -37,7 +43,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
37
43
|
|
|
38
44
|
### Features
|
|
39
45
|
|
|
40
|
-
* common: Added tests for the isRecord
|
|
46
|
+
* common: Added tests for the isRecord
|
|
47
|
+
method ([02dc7ce](https://github.com/R-Vision/rsdk/commit/02dc7ce2a8edaac8bec9e63e4200d55a4987ced5))
|
|
41
48
|
|
|
42
49
|
### Bug Fixes
|
|
43
50
|
|
|
@@ -55,7 +62,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
55
62
|
|
|
56
63
|
### Bug Fixes
|
|
57
64
|
|
|
58
|
-
* **common.node:** correctly calculate
|
|
65
|
+
* **common.node:** correctly calculate
|
|
66
|
+
accumulateDuration ([#128](https://github.com/R-Vision/rsdk/issues/128)) ([09d0d53](https://github.com/R-Vision/rsdk/commit/09d0d532a99a1d93e4fba4fa78d407b4328b1ec2))
|
|
59
67
|
|
|
60
68
|
## [3.5.0-next.2](https://github.com/R-Vision/rsdk/compare/v3.5.0-next.1...v3.5.0-next.2) (2023-09-26)
|
|
61
69
|
|
|
@@ -65,9 +73,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
65
73
|
|
|
66
74
|
### Bug Fixes
|
|
67
75
|
|
|
68
|
-
* **common:** added dedicated stopwatch
|
|
69
|
-
|
|
70
|
-
* **common:** stopwatch
|
|
76
|
+
* **common:** added dedicated stopwatch
|
|
77
|
+
exception ([e81a8f1](https://github.com/R-Vision/rsdk/commit/e81a8f10898473751fa81d473503e488719d9750))
|
|
78
|
+
* **common:** fix stopwatch and migrate to
|
|
79
|
+
bigint ([08a14ba](https://github.com/R-Vision/rsdk/commit/08a14bacd0342ee7e0d3d9224dc93f102fb309be))
|
|
80
|
+
* **common:** stopwatch return this on methods, dont new
|
|
81
|
+
instance ([61c8be2](https://github.com/R-Vision/rsdk/commit/61c8be238e0c4aea582981196e65bc73823872ff))
|
|
71
82
|
|
|
72
83
|
## [3.2.0](https://github.com/R-Vision/rsdk/compare/v3.2.0-next.2...v3.2.0) (2023-08-09)
|
|
73
84
|
|
|
@@ -85,7 +96,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
85
96
|
|
|
86
97
|
### Features
|
|
87
98
|
|
|
88
|
-
* **kafka:** added option to consume by topic
|
|
99
|
+
* **kafka:** added option to consume by topic
|
|
100
|
+
name ([#93](https://github.com/R-Vision/rsdk/issues/93)) ([09b4c1b](https://github.com/R-Vision/rsdk/commit/09b4c1bd515c1c2c3ccda17851fbe79e64ea8ac5))
|
|
89
101
|
|
|
90
102
|
## [3.0.2](https://github.com/R-Vision/rsdk/compare/v3.0.1...v3.0.2) (2023-08-07)
|
|
91
103
|
|
|
@@ -117,13 +129,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
117
129
|
|
|
118
130
|
### Features
|
|
119
131
|
|
|
120
|
-
* **@rsdk/common:** improve Timespan
|
|
132
|
+
* **@rsdk/common:** improve Timespan
|
|
133
|
+
class ([f28a6b6](https://github.com/R-Vision/rsdk/commit/f28a6b68d3dfbf76f4a3f7a7225ef455526ccc0d))
|
|
121
134
|
|
|
122
135
|
# [2.6.0-next.11](https://github.com/R-Vision/rsdk/compare/v2.6.0-next.10...v2.6.0-next.11) (2023-07-26)
|
|
123
136
|
|
|
124
137
|
### Features
|
|
125
138
|
|
|
126
|
-
* **@rsdk/common:** add support of negative durations in Timespan
|
|
139
|
+
* **@rsdk/common:** add support of negative durations in Timespan
|
|
140
|
+
class ([52ede3c](https://github.com/R-Vision/rsdk/commit/52ede3c69005a4091f591a78264fbd9bc6d0bcd2))
|
|
127
141
|
|
|
128
142
|
# [2.6.0-next.9](https://github.com/R-Vision/rsdk/compare/v2.6.0-next.8...v2.6.0-next.9) (2023-07-25)
|
|
129
143
|
|
|
@@ -133,7 +147,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
133
147
|
|
|
134
148
|
### Features
|
|
135
149
|
|
|
136
|
-
* **@rsdk/common:** add Case static
|
|
150
|
+
* **@rsdk/common:** add Case static
|
|
151
|
+
class ([c8dc5b4](https://github.com/R-Vision/rsdk/commit/c8dc5b4e6306093541091c12c698263accbe55c1))
|
|
137
152
|
|
|
138
153
|
## [2.4.2](https://github.com/R-Vision/rsdk/compare/v2.4.2-next.0...v2.4.2) (2023-06-16)
|
|
139
154
|
|
|
@@ -143,7 +158,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
143
158
|
|
|
144
159
|
### Bug Fixes
|
|
145
160
|
|
|
146
|
-
* **eslint-plugin:** normalize
|
|
161
|
+
* **eslint-plugin:** normalize
|
|
162
|
+
tsconfig.lint.json ([25d77cd](https://github.com/R-Vision/rsdk/commit/25d77cd69206fa6e1c79ba6ae27ee89276b0cfa2))
|
|
147
163
|
|
|
148
164
|
## [2.4.1](https://github.com/R-Vision/rsdk/compare/v2.4.1-next.2...v2.4.1) (2023-06-15)
|
|
149
165
|
|
|
@@ -165,13 +181,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
165
181
|
|
|
166
182
|
### Bug Fixes
|
|
167
183
|
|
|
168
|
-
* cycle deps, remove outDir from base.json in tsconfig, rework interact with AutodocMetadata and RsdkMetadata, fix
|
|
184
|
+
* cycle deps, remove outDir from base.json in tsconfig, rework interact with AutodocMetadata and RsdkMetadata, fix
|
|
185
|
+
unprovided imports ([cc6434b](https://github.com/R-Vision/rsdk/commit/cc6434b9d165e570bdbb2baad76b00acd14577b2))
|
|
169
186
|
|
|
170
187
|
## 1.0.12 (2023-05-23)
|
|
171
188
|
|
|
172
189
|
### Bug Fixes
|
|
173
190
|
|
|
174
|
-
* remove private dependencies from `peerDependencies`
|
|
191
|
+
* remove private dependencies from `peerDependencies`
|
|
192
|
+
section ([0bce6ff](https://github.com/R-Vision/rsdk/commit/0bce6ffb5b699e2ed1dc9aca77cbdbf085267ff7))
|
|
175
193
|
|
|
176
194
|
## 1.0.11 (2023-05-23)
|
|
177
195
|
|
|
@@ -181,7 +199,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
181
199
|
|
|
182
200
|
### Bug Fixes
|
|
183
201
|
|
|
184
|
-
* add "access: public" to new
|
|
202
|
+
* add "access: public" to new
|
|
203
|
+
packages ([04d5983](https://github.com/R-Vision/rsdk/commit/04d5983cfa3e97c5d8219e07208a0499a8c6bc83))
|
|
185
204
|
|
|
186
205
|
## 1.0.9 (2023-05-21)
|
|
187
206
|
|
|
@@ -211,7 +230,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
211
230
|
|
|
212
231
|
### Bug Fixes
|
|
213
232
|
|
|
214
|
-
* builtin make not private in
|
|
233
|
+
* builtin make not private in
|
|
234
|
+
npm ([50c83b6](https://github.com/R-Vision/rsdk/commit/50c83b6454f9a89f1e99d3b33a497ce2c029d8c6))
|
|
215
235
|
|
|
216
236
|
## 1.0.2 (2023-05-10)
|
|
217
237
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.class.js","sourceRoot":"","sources":["../../src/convert/convert.class.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC;;GAEG;AACH,uDAAuD;AACvD,sEAAsE;;;AAGtE,oCAAgC;AAEhC;;;;;GAKG;AACH,MAAa,OAAO;IAClB;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,CAAC,KAAc;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"convert.class.js","sourceRoot":"","sources":["../../src/convert/convert.class.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC;;GAEG;AACH,uDAAuD;AACvD,sEAAsE;;;AAGtE,oCAAgC;AAEhC;;;;;GAKG;AACH,MAAa,OAAO;IAClB;;;;;;;;;OASG;IACH,MAAM,CAA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,EAAE,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CACvC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvE,CAAC"}
|
|
@@ -13,19 +13,31 @@ function observableToAsyncIterable(observable) {
|
|
|
13
13
|
const pushValue = (value) => {
|
|
14
14
|
if (pullQueue.length > 0) {
|
|
15
15
|
// It is safe to use the ! operator here as we check the length.
|
|
16
|
-
pullQueue.shift()({
|
|
16
|
+
pullQueue.shift()({
|
|
17
|
+
value,
|
|
18
|
+
done: false,
|
|
19
|
+
});
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
|
-
pushQueue.push({
|
|
22
|
+
pushQueue.push({
|
|
23
|
+
value,
|
|
24
|
+
done: false,
|
|
25
|
+
});
|
|
20
26
|
}
|
|
21
27
|
};
|
|
22
28
|
const pushError = (error) => {
|
|
23
29
|
if (pullQueue.length > 0) {
|
|
24
30
|
// It is safe to use the ! operator here as we check the length.
|
|
25
|
-
pullQueue.shift()({
|
|
31
|
+
pullQueue.shift()({
|
|
32
|
+
value: { errors: [error] },
|
|
33
|
+
done: false,
|
|
34
|
+
});
|
|
26
35
|
}
|
|
27
36
|
else {
|
|
28
|
-
pushQueue.push({
|
|
37
|
+
pushQueue.push({
|
|
38
|
+
value: { errors: [error] },
|
|
39
|
+
done: false,
|
|
40
|
+
});
|
|
29
41
|
}
|
|
30
42
|
};
|
|
31
43
|
const pushDone = () => {
|
|
@@ -63,7 +75,10 @@ function observableToAsyncIterable(observable) {
|
|
|
63
75
|
listening = false;
|
|
64
76
|
subscription.unsubscribe();
|
|
65
77
|
for (const resolve of pullQueue) {
|
|
66
|
-
resolve({
|
|
78
|
+
resolve({
|
|
79
|
+
value: undefined,
|
|
80
|
+
done: true,
|
|
81
|
+
});
|
|
67
82
|
}
|
|
68
83
|
pullQueue.length = 0;
|
|
69
84
|
pushQueue.length = 0;
|
|
@@ -76,7 +91,10 @@ function observableToAsyncIterable(observable) {
|
|
|
76
91
|
},
|
|
77
92
|
return() {
|
|
78
93
|
emptyQueue();
|
|
79
|
-
return Promise.resolve({
|
|
94
|
+
return Promise.resolve({
|
|
95
|
+
value: undefined,
|
|
96
|
+
done: true,
|
|
97
|
+
});
|
|
80
98
|
},
|
|
81
99
|
throw(error) {
|
|
82
100
|
emptyQueue();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable-to-async-iterable.js","sourceRoot":"","sources":["../../src/observable/observable-to-async-iterable.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAMrE;;;GAGG;AACH,SAAgB,yBAAyB,CACvC,UAAyB;IAEzB,MAAM,SAAS,GAAoB,EAAE,CAAC;IACtC,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE;QAC/B,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"observable-to-async-iterable.js","sourceRoot":"","sources":["../../src/observable/observable-to-async-iterable.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAMrE;;;GAGG;AACH,SAAgB,yBAAyB,CACvC,UAAyB;IAEzB,MAAM,SAAS,GAAoB,EAAE,CAAC;IACtC,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE;QAC/B,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,gEAAgE;YAChE,SAAS,CAAC,KAAK,EAAG,CAAC;gBACjB,KAAK;gBACL,IAAI,EAAE,KAAK;aACZ,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,SA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,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAAlD,QAAA,IAAI,QAA8C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-random-bytes.js","sourceRoot":"","sources":["../../src/strings/get-random-bytes.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAc;IAC3C,MAAM,MAAM,GAAG,kBAAkB,CAAC;IAClC,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"get-random-bytes.js","sourceRoot":"","sources":["../../src/strings/get-random-bytes.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,MAAc;IAC3C,MAAM,MAAM,GAAG,kBAAkB,CAAC;IAClC,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QAE5C,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAVD,wCAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.fn.js","sourceRoot":"","sources":["../../src/strings/text.fn.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACI,MAAM,IAAI,GAAG,CAClB,SAA+B,EAC/B,GAAG,iBAA4B,EACvB,EAAE;IACV,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,iBAAiB,CAAC,CAAC;IAEnE,IAAI,CAAC,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"text.fn.js","sourceRoot":"","sources":["../../src/strings/text.fn.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACI,MAAM,IAAI,GAAG,CAClB,SAA+B,EAC/B,GAAG,iBAA4B,EACvB,EAAE;IACV,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,iBAAiB,CAAC,CAAC;IAEnE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC,CAAC;AAXW,QAAA,IAAI,QAWf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeat.fn.js","sourceRoot":"","sources":["../../src/time/repeat.fn.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAGtC;;;;GAIG;AACI,MAAM,MAAM,GAAG,CACpB,QAAkB,EAClB,EAA0C,EACnC,EAAE;IACT,MAAM,KAAK,GAAG,IAAI,mBAAK,EAAE,CAAC;IAE1B,UAAU,CAAC,KAAK,UAAU,SAAS;QACjC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;QAEhB,IAAI,KAAK,CAAC,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"repeat.fn.js","sourceRoot":"","sources":["../../src/time/repeat.fn.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAGtC;;;;GAIG;AACI,MAAM,MAAM,GAAG,CACpB,QAAkB,EAClB,EAA0C,EACnC,EAAE;IACT,MAAM,KAAK,GAAG,IAAI,mBAAK,EAAE,CAAC;IAE1B,UAAU,CAAC,KAAK,UAAU,SAAS;QACjC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;QAEhB,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACpB,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAEtB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAfW,QAAA,MAAM,UAejB;AAEF,QAAQ;AACR,mEAAmE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stopwatch.class.js","sourceRoot":"","sources":["../../src/time/stopwatch.class.ts"],"names":[],"mappings":";;;AAAA,MAAsB,kBAAmB,SAAQ,KAAK;IAC3C,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;CACvC;AAFD,gDAEC;AAED,MAAa,uBAAwB,SAAQ,kBAAkB;IAC7D;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACrC,CAAC;CACF;AAJD,0DAIC;AAED,MAAa,mBAAoB,SAAQ,kBAAkB;IACzD;QACE,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACjC,CAAC;CACF;AAJD,kDAIC;AAED;;;;;GAKG;AACH,MAAa,SAAS;IACZ,MAAM,GAAkB,IAAI,CAAC;IAC7B,kBAAkB,GAAG,EAAE,CAAC;IAEhC;;;;;;OAMG;IACH,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,IAAI,OAAO;QACT,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;
|
|
1
|
+
{"version":3,"file":"stopwatch.class.js","sourceRoot":"","sources":["../../src/time/stopwatch.class.ts"],"names":[],"mappings":";;;AAAA,MAAsB,kBAAmB,SAAQ,KAAK;IAC3C,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;CACvC;AAFD,gDAEC;AAED,MAAa,uBAAwB,SAAQ,kBAAkB;IAC7D;QACE,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACrC,CAAC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AAEM,MAAM,QAAQ,GAAG,CAAC,GAAmB,EAAY,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAAlE,QAAA,QAAQ,YAA0D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.class.js","sourceRoot":"","sources":["../../src/types/assert.class.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAU;QACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"assert.class.js","sourceRoot":"","sources":["../../src/types/assert.class.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACjB,MAAM,CAAC,QAAQ,CAAC,CAAU;QACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,CAAU;QACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,CAAU;QACvB,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC;IACtE,CAAC;CACF;AAxBD,wBAwBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-like.type.js","sourceRoot":"","sources":["../../src/types/error-like.type.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"error-like.type.js","sourceRoot":"","sources":["../../src/types/error-like.type.ts"],"names":[],"mappings":";;;AAMO,MAAM,WAAW,GAAG,CACzB,CAA6C,EAC7B,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,IAAI,CAAC,CAAC;AAF9B,QAAA,WAAW,eAEmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@rsdk/jest/jest.config.e2e');
|
package/jest.config.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@rsdk/jest/jest.config.unit');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/common",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.15",
|
|
4
4
|
"description": "Useful common classes, functions and types",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"rxjs": "^7.8.1"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "8abd89d7800375749b024410dc3465ff40389277"
|
|
20
20
|
}
|
|
@@ -61,31 +61,146 @@ describe('Convert', () => {
|
|
|
61
61
|
|
|
62
62
|
const tt: Case[] = [
|
|
63
63
|
// Positive
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
{
|
|
65
|
+
name: 'Correct integer (string)',
|
|
66
|
+
input: '123',
|
|
67
|
+
success: true,
|
|
68
|
+
output: 123
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Correct integer (number)',
|
|
72
|
+
input: 123,
|
|
73
|
+
success: true,
|
|
74
|
+
output: 123
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Correct negative integer (number)',
|
|
78
|
+
input: -123,
|
|
79
|
+
success: true,
|
|
80
|
+
output: -123
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Correct negative integer (string)',
|
|
84
|
+
input: '-123',
|
|
85
|
+
success: true,
|
|
86
|
+
output: -123
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Correct float (string)',
|
|
90
|
+
input: '123.1',
|
|
91
|
+
success: true,
|
|
92
|
+
output: 123.1
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'Correct float (number)',
|
|
96
|
+
input: 123.1,
|
|
97
|
+
success: true,
|
|
98
|
+
output: 123.1
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Correct negative float (number)',
|
|
102
|
+
input: -123.4,
|
|
103
|
+
success: true,
|
|
104
|
+
output: -123.4
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Correct negative float (string)',
|
|
108
|
+
input: '-123.4',
|
|
109
|
+
success: true,
|
|
110
|
+
output: -123.4
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Zero',
|
|
114
|
+
input: 0,
|
|
115
|
+
success: true,
|
|
116
|
+
output: 0
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'Zero string',
|
|
120
|
+
input: '0',
|
|
121
|
+
success: true,
|
|
122
|
+
output: 0
|
|
123
|
+
},
|
|
74
124
|
|
|
75
125
|
// Negative
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
126
|
+
{
|
|
127
|
+
name: 'Incorrect float (string)',
|
|
128
|
+
input: '123,1',
|
|
129
|
+
success: false,
|
|
130
|
+
output: null
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'Empty string',
|
|
134
|
+
input: '',
|
|
135
|
+
success: false,
|
|
136
|
+
output: null
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'True (boolean)',
|
|
140
|
+
input: true,
|
|
141
|
+
success: false,
|
|
142
|
+
output: null
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'True (string lowercase)',
|
|
146
|
+
input: 'true',
|
|
147
|
+
success: false,
|
|
148
|
+
output: null
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'True (string mixedcase)',
|
|
152
|
+
input: 'TrUe',
|
|
153
|
+
success: false,
|
|
154
|
+
output: null
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'False (boolean)',
|
|
158
|
+
input: false,
|
|
159
|
+
success: false,
|
|
160
|
+
output: null
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'False (string lowercase)',
|
|
164
|
+
input: 'false',
|
|
165
|
+
success: false,
|
|
166
|
+
output: null
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'False (string mixedcase)',
|
|
170
|
+
input: 'FalSe',
|
|
171
|
+
success: false,
|
|
172
|
+
output: null
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'Trash (string)',
|
|
176
|
+
input: 'sdfg',
|
|
177
|
+
success: false,
|
|
178
|
+
output: null
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Trash (object)',
|
|
182
|
+
input: { a: 1 },
|
|
183
|
+
success: false,
|
|
184
|
+
output: null
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'Trash (object)',
|
|
188
|
+
input: { a: 1 },
|
|
189
|
+
success: false,
|
|
190
|
+
output: null
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'null',
|
|
194
|
+
input: null,
|
|
195
|
+
success: false,
|
|
196
|
+
output: null
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'undefined',
|
|
200
|
+
input: undefined,
|
|
201
|
+
success: false,
|
|
202
|
+
output: null
|
|
203
|
+
},
|
|
89
204
|
];
|
|
90
205
|
|
|
91
206
|
for (const { name, input, success, output } of tt) {
|
|
@@ -143,6 +258,7 @@ describe('Convert', () => {
|
|
|
143
258
|
KEY_1,
|
|
144
259
|
KEY_2,
|
|
145
260
|
}
|
|
261
|
+
|
|
146
262
|
enum Numeric {
|
|
147
263
|
KEY_1 = 0,
|
|
148
264
|
KEY_2 = 1,
|
|
@@ -173,12 +289,42 @@ describe('Convert', () => {
|
|
|
173
289
|
|
|
174
290
|
const common: Subcase[] = [
|
|
175
291
|
// All negative!
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
292
|
+
{
|
|
293
|
+
name: 'Random string',
|
|
294
|
+
input: 'sadfasdf',
|
|
295
|
+
success: false,
|
|
296
|
+
output: null
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: 'Random number',
|
|
300
|
+
input: 123,
|
|
301
|
+
success: false,
|
|
302
|
+
output: null
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: 'Random boolean',
|
|
306
|
+
input: true,
|
|
307
|
+
success: false,
|
|
308
|
+
output: null
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: 'Random object',
|
|
312
|
+
input: { a: 1 },
|
|
313
|
+
success: false,
|
|
314
|
+
output: null
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'null',
|
|
318
|
+
input: null,
|
|
319
|
+
success: false,
|
|
320
|
+
output: null
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: 'undefined',
|
|
324
|
+
input: undefined,
|
|
325
|
+
success: false,
|
|
326
|
+
output: null
|
|
327
|
+
},
|
|
182
328
|
];
|
|
183
329
|
|
|
184
330
|
const tt: Case[] = [
|
|
@@ -187,16 +333,56 @@ describe('Convert', () => {
|
|
|
187
333
|
e: Implicit,
|
|
188
334
|
subcases: [
|
|
189
335
|
// Positive
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
336
|
+
{
|
|
337
|
+
name: 'Zero (number)',
|
|
338
|
+
input: 0,
|
|
339
|
+
success: true,
|
|
340
|
+
output: Implicit.KEY_1
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: 'Zero (string)',
|
|
344
|
+
input: '0',
|
|
345
|
+
success: true,
|
|
346
|
+
output: Implicit.KEY_1
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'One (number)',
|
|
350
|
+
input: 1,
|
|
351
|
+
success: true,
|
|
352
|
+
output: Implicit.KEY_2
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: 'One (number)',
|
|
356
|
+
input: '1',
|
|
357
|
+
success: true,
|
|
358
|
+
output: Implicit.KEY_2
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'KEY_1',
|
|
362
|
+
input: 'KEY_1',
|
|
363
|
+
success: true,
|
|
364
|
+
output: Implicit.KEY_1
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: 'KEY_2',
|
|
368
|
+
input: 'KEY_2',
|
|
369
|
+
success: true,
|
|
370
|
+
output: Implicit.KEY_2
|
|
371
|
+
},
|
|
196
372
|
|
|
197
373
|
// Negative
|
|
198
|
-
{
|
|
199
|
-
|
|
374
|
+
{
|
|
375
|
+
name: 'null',
|
|
376
|
+
input: null,
|
|
377
|
+
success: false,
|
|
378
|
+
output: null
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'undefined',
|
|
382
|
+
input: undefined,
|
|
383
|
+
success: false,
|
|
384
|
+
output: null
|
|
385
|
+
},
|
|
200
386
|
...common,
|
|
201
387
|
],
|
|
202
388
|
},
|
|
@@ -205,16 +391,56 @@ describe('Convert', () => {
|
|
|
205
391
|
e: Numeric,
|
|
206
392
|
subcases: [
|
|
207
393
|
// Positive
|
|
208
|
-
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
394
|
+
{
|
|
395
|
+
name: 'Zero (number)',
|
|
396
|
+
input: 0,
|
|
397
|
+
success: true,
|
|
398
|
+
output: Numeric.KEY_1
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'Zero (string)',
|
|
402
|
+
input: '0',
|
|
403
|
+
success: true,
|
|
404
|
+
output: Numeric.KEY_1
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'One (number)',
|
|
408
|
+
input: 1,
|
|
409
|
+
success: true,
|
|
410
|
+
output: Numeric.KEY_2
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: 'One (number)',
|
|
414
|
+
input: '1',
|
|
415
|
+
success: true,
|
|
416
|
+
output: Numeric.KEY_2
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'KEY_1',
|
|
420
|
+
input: 'KEY_1',
|
|
421
|
+
success: true,
|
|
422
|
+
output: Numeric.KEY_1
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: 'KEY_2',
|
|
426
|
+
input: 'KEY_2',
|
|
427
|
+
success: true,
|
|
428
|
+
output: Numeric.KEY_2
|
|
429
|
+
},
|
|
214
430
|
|
|
215
431
|
// Negative
|
|
216
|
-
{
|
|
217
|
-
|
|
432
|
+
{
|
|
433
|
+
name: 'null',
|
|
434
|
+
input: null,
|
|
435
|
+
success: false,
|
|
436
|
+
output: null
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: 'undefined',
|
|
440
|
+
input: undefined,
|
|
441
|
+
success: false,
|
|
442
|
+
output: null
|
|
443
|
+
},
|
|
218
444
|
...common,
|
|
219
445
|
]
|
|
220
446
|
},
|
|
@@ -223,16 +449,56 @@ describe('Convert', () => {
|
|
|
223
449
|
e: Strings,
|
|
224
450
|
subcases: [
|
|
225
451
|
// Positive
|
|
226
|
-
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
452
|
+
{
|
|
453
|
+
name: 'Zero (string)',
|
|
454
|
+
input: '0',
|
|
455
|
+
success: true,
|
|
456
|
+
output: Strings.KEY_1
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: 'One (number)',
|
|
460
|
+
input: '1',
|
|
461
|
+
success: true,
|
|
462
|
+
output: Strings.KEY_2
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: 'KEY_1',
|
|
466
|
+
input: 'KEY_1',
|
|
467
|
+
success: true,
|
|
468
|
+
output: Strings.KEY_1
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: 'KEY_2',
|
|
472
|
+
input: 'KEY_2',
|
|
473
|
+
success: true,
|
|
474
|
+
output: Strings.KEY_2
|
|
475
|
+
},
|
|
230
476
|
|
|
231
477
|
// Negative
|
|
232
|
-
{
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
478
|
+
{
|
|
479
|
+
name: 'null',
|
|
480
|
+
input: null,
|
|
481
|
+
success: false,
|
|
482
|
+
output: null
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: 'undefined',
|
|
486
|
+
input: undefined,
|
|
487
|
+
success: false,
|
|
488
|
+
output: null
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: 'Zero (number)',
|
|
492
|
+
input: 0,
|
|
493
|
+
success: false,
|
|
494
|
+
output: null
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: 'One (number)',
|
|
498
|
+
input: 1,
|
|
499
|
+
success: false,
|
|
500
|
+
output: null
|
|
501
|
+
},
|
|
236
502
|
...common,
|
|
237
503
|
],
|
|
238
504
|
},
|
|
@@ -241,16 +507,56 @@ describe('Convert', () => {
|
|
|
241
507
|
e: Mixed,
|
|
242
508
|
subcases: [
|
|
243
509
|
// Positive
|
|
244
|
-
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
510
|
+
{
|
|
511
|
+
name: 'Zero (string)',
|
|
512
|
+
input: '0',
|
|
513
|
+
success: true,
|
|
514
|
+
output: Mixed.KEY_1
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: 'One (number)',
|
|
518
|
+
input: 1,
|
|
519
|
+
success: true,
|
|
520
|
+
output: Mixed.KEY_2
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'One (number)',
|
|
524
|
+
input: '1',
|
|
525
|
+
success: true,
|
|
526
|
+
output: Mixed.KEY_2
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
name: 'KEY_1',
|
|
530
|
+
input: 'KEY_1',
|
|
531
|
+
success: true,
|
|
532
|
+
output: Mixed.KEY_1
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: 'KEY_2',
|
|
536
|
+
input: 'KEY_2',
|
|
537
|
+
success: true,
|
|
538
|
+
output: Mixed.KEY_2
|
|
539
|
+
},
|
|
249
540
|
|
|
250
541
|
// Negative
|
|
251
|
-
{
|
|
252
|
-
|
|
253
|
-
|
|
542
|
+
{
|
|
543
|
+
name: 'null',
|
|
544
|
+
input: null,
|
|
545
|
+
success: false,
|
|
546
|
+
output: null
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: 'undefined',
|
|
550
|
+
input: undefined,
|
|
551
|
+
success: false,
|
|
552
|
+
output: null
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
name: 'Zero (number)',
|
|
556
|
+
input: 0,
|
|
557
|
+
success: false,
|
|
558
|
+
output: null
|
|
559
|
+
},
|
|
254
560
|
...common,
|
|
255
561
|
],
|
|
256
562
|
},
|
|
@@ -16,40 +16,55 @@ describe('misc', () => {
|
|
|
16
16
|
|
|
17
17
|
const tt: Case[] = [
|
|
18
18
|
// Positive
|
|
19
|
-
{ name: 'Correct object (literal)',
|
|
20
|
-
{ name: 'Correct object (Object())',
|
|
21
|
-
{ name: 'Correct object (new Object())',
|
|
22
|
-
{ name: 'Correct object (Object.create())',
|
|
23
|
-
{ name: 'Correct object (Object.assign())',
|
|
19
|
+
{ name: 'Correct object (literal)', input: {}, success: true, output: true },
|
|
20
|
+
{ name: 'Correct object (Object())', input: {}, success: true, output: true },
|
|
21
|
+
{ name: 'Correct object (new Object())', input: {}, success: true, output: true },
|
|
22
|
+
{ name: 'Correct object (Object.create())', input: Object.create({}), success: true, output: true },
|
|
23
|
+
{ name: 'Correct object (Object.assign())', input: Object.assign({}, {}), success: true, output: true },
|
|
24
24
|
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{ name: '
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{ name: '
|
|
39
|
-
{ name: '
|
|
40
|
-
{ name: '
|
|
41
|
-
{ name: '
|
|
42
|
-
{ name: '
|
|
43
|
-
{ name: '
|
|
44
|
-
{ name: '
|
|
45
|
-
{ name: '
|
|
25
|
+
{
|
|
26
|
+
name: 'Function (declarative)', input: function t(): void {}, success: true, output: false
|
|
27
|
+
},
|
|
28
|
+
{ name: 'new Function() instance', input: new Function(), success: true, output: false },
|
|
29
|
+
{
|
|
30
|
+
name: 'Function constructor', input: new (function t() {})(), success: true, output: false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Class', input: class T {}, success: true, output: false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Class constructor', input: new (class T {})(), success: true, output: false
|
|
37
|
+
},
|
|
38
|
+
{ name: 'Array (literal)', input: [], success: true, output: false },
|
|
39
|
+
{ name: 'Array() instance', input: Array(), success: true, output: false },
|
|
40
|
+
{ name: 'new Array() instance', input: [], success: true, output: false },
|
|
41
|
+
{ name: 'The Map (new Map())', input: new Map(), success: true, output: false },
|
|
42
|
+
{ name: 'The Set (new Set())', input: new Set(), success: true, output: false },
|
|
43
|
+
{ name: 'Date object', input: new Date(), success: true, output: false },
|
|
44
|
+
{ name: 'String oject', input: String('str'), success: true, output: false },
|
|
45
|
+
{ name: 'Number object', input: Number(1), success: true, output: false },
|
|
46
|
+
{ name: 'Boolean object', input: Boolean(true), success: true, output: false },
|
|
47
|
+
{ name: 'BigInt', input: BigInt(999999999999), success: true, output: false },
|
|
48
|
+
{ name: 'Symbol', input: Symbol(), success: true, output: false },
|
|
49
|
+
{ name: 'null', input: null, success: true, output: false },
|
|
50
|
+
{ name: 'undefined', input: undefined, success: true, output: false },
|
|
51
|
+
{ name: 'true', input: true, success: true, output: false },
|
|
52
|
+
{ name: 'number', input: 12, success: true, output: false },
|
|
53
|
+
{ name: 'string', input: 'str', success: true, output: false },
|
|
46
54
|
];
|
|
47
55
|
|
|
48
|
-
for (const {
|
|
56
|
+
for (const {
|
|
57
|
+
name,
|
|
58
|
+
input,
|
|
59
|
+
success,
|
|
60
|
+
output
|
|
61
|
+
} of tt) {
|
|
49
62
|
if (success) {
|
|
50
|
-
it(name, () => expect(isRecord(input))
|
|
63
|
+
it(name, () => expect(isRecord(input))
|
|
64
|
+
.toBe(output));
|
|
51
65
|
} else {
|
|
52
|
-
it(name, () => expect(() => isRecord(input))
|
|
66
|
+
it(name, () => expect(() => isRecord(input))
|
|
67
|
+
.toThrow());
|
|
53
68
|
}
|
|
54
69
|
}
|
|
55
70
|
});
|
|
@@ -35,7 +35,17 @@ describe('should handle circular', () => {
|
|
|
35
35
|
${a} | ${{ a: '[circular]' }}
|
|
36
36
|
${b} | ${{ a: { a: '[circular]' }, b: '[circular]' }}
|
|
37
37
|
${c} | ${{ a: { b: { c: '[circular]' } } }}
|
|
38
|
-
${d}
|
|
38
|
+
${d} | ${{
|
|
39
|
+
d: [
|
|
40
|
+
{ a: '[circular]' },
|
|
41
|
+
{
|
|
42
|
+
a: '[circular]',
|
|
43
|
+
b: '[circular]',
|
|
44
|
+
},
|
|
45
|
+
{ a: { b: { c: '[circular]' } } },
|
|
46
|
+
'[circular]',
|
|
47
|
+
],
|
|
48
|
+
}}
|
|
39
49
|
`('$input to be $output', ({ input, output }) => {
|
|
40
50
|
expect(normalizer()(input)).toEqual(output);
|
|
41
51
|
});
|
|
@@ -19,18 +19,30 @@ export function observableToAsyncIterable<T>(
|
|
|
19
19
|
const pushValue = (value: any) => {
|
|
20
20
|
if (pullQueue.length > 0) {
|
|
21
21
|
// It is safe to use the ! operator here as we check the length.
|
|
22
|
-
pullQueue.shift()!({
|
|
22
|
+
pullQueue.shift()!({
|
|
23
|
+
value,
|
|
24
|
+
done: false,
|
|
25
|
+
});
|
|
23
26
|
} else {
|
|
24
|
-
pushQueue.push({
|
|
27
|
+
pushQueue.push({
|
|
28
|
+
value,
|
|
29
|
+
done: false,
|
|
30
|
+
});
|
|
25
31
|
}
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
const pushError = (error: any) => {
|
|
29
35
|
if (pullQueue.length > 0) {
|
|
30
36
|
// It is safe to use the ! operator here as we check the length.
|
|
31
|
-
pullQueue.shift()!({
|
|
37
|
+
pullQueue.shift()!({
|
|
38
|
+
value: { errors: [error] },
|
|
39
|
+
done: false,
|
|
40
|
+
});
|
|
32
41
|
} else {
|
|
33
|
-
pushQueue.push({
|
|
42
|
+
pushQueue.push({
|
|
43
|
+
value: { errors: [error] },
|
|
44
|
+
done: false,
|
|
45
|
+
});
|
|
34
46
|
}
|
|
35
47
|
};
|
|
36
48
|
|
|
@@ -72,7 +84,10 @@ export function observableToAsyncIterable<T>(
|
|
|
72
84
|
listening = false;
|
|
73
85
|
subscription.unsubscribe();
|
|
74
86
|
for (const resolve of pullQueue) {
|
|
75
|
-
resolve({
|
|
87
|
+
resolve({
|
|
88
|
+
value: undefined,
|
|
89
|
+
done: true,
|
|
90
|
+
});
|
|
76
91
|
}
|
|
77
92
|
pullQueue.length = 0;
|
|
78
93
|
pushQueue.length = 0;
|
|
@@ -86,7 +101,10 @@ export function observableToAsyncIterable<T>(
|
|
|
86
101
|
},
|
|
87
102
|
return() {
|
|
88
103
|
emptyQueue();
|
|
89
|
-
return Promise.resolve({
|
|
104
|
+
return Promise.resolve({
|
|
105
|
+
value: undefined,
|
|
106
|
+
done: true,
|
|
107
|
+
});
|
|
90
108
|
},
|
|
91
109
|
throw(error) {
|
|
92
110
|
emptyQueue();
|
package/src/size/size.spec.ts
CHANGED
|
@@ -26,7 +26,7 @@ describe('Size', () => {
|
|
|
26
26
|
// KB
|
|
27
27
|
{ name: '1kb', s: new Size(1, 'kb'), gb: 0, mb: 0.001, kb: 1, b: 1_024 },
|
|
28
28
|
{ name: '2kb', s: new Size(2, 'kb'), gb: 0, mb: 0.002, kb: 2, b: 2_048 },
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
// Bytes
|
|
31
31
|
{ name: '1b', s: new Size(1, 'b'), gb: 0, mb: 0, kb: 0.001, b: 1 },
|
|
32
32
|
{ name: '2b', s: new Size(2, 'b'), gb: 0, mb: 0, kb: 0.002, b: 2 },
|
|
@@ -11,13 +11,13 @@ type Builtin =
|
|
|
11
11
|
export type DeepPartial<T> = T extends Builtin
|
|
12
12
|
? T
|
|
13
13
|
: T extends Array<infer U>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
? Array<DeepPartial<U>>
|
|
15
|
+
: T extends ReadonlyArray<infer U>
|
|
16
|
+
? ReadonlyArray<DeepPartial<U>>
|
|
17
|
+
: T extends { $case: string }
|
|
18
|
+
? { [K in keyof Omit<T, '$case'>]?: DeepPartial<T[K]> } & {
|
|
19
|
+
$case: T['$case'];
|
|
20
|
+
}
|
|
21
|
+
: T extends {}
|
|
22
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
23
|
+
: Partial<T>;
|