@dooboostore/simple-boot-http-server 1.0.25 → 1.0.27
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/README.md +100 -14
- package/dist/cjs/SimpleBootHttpServer.js +34 -18
- package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
- package/dist/cjs/bundle-entry.js +34 -24
- package/dist/cjs/bundle-entry.js.map +2 -2
- package/dist/cjs/codes/Mimes.js +2 -0
- package/dist/cjs/codes/Mimes.js.map +2 -2
- package/dist/cjs/decorators/MethodMapping.js +2 -2
- package/dist/cjs/decorators/MethodMapping.js.map +2 -2
- package/dist/cjs/filters/ResourceFilter.js +0 -1
- package/dist/cjs/filters/ResourceFilter.js.map +2 -2
- package/dist/cjs/option/HttpServerOption.js.map +2 -2
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/cjs/websocket/WebSocketClient.js +2 -1
- package/dist/cjs/websocket/WebSocketClient.js.map +2 -2
- package/dist/cjs/websocket/WebSocketManager.js +68 -40
- package/dist/cjs/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm/SimpleBootHttpServer.js +34 -18
- package/dist/esm/SimpleBootHttpServer.js.map +2 -2
- package/dist/esm/bundle-entry.js +14 -12
- package/dist/esm/bundle-entry.js.map +2 -2
- package/dist/esm/codes/Mimes.js +2 -0
- package/dist/esm/codes/Mimes.js.map +2 -2
- package/dist/esm/decorators/MethodMapping.js +2 -2
- package/dist/esm/decorators/MethodMapping.js.map +2 -2
- package/dist/esm/filters/ResourceFilter.js +0 -1
- package/dist/esm/filters/ResourceFilter.js.map +2 -2
- package/dist/esm/option/HttpServerOption.js.map +2 -2
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/esm/websocket/WebSocketClient.js +3 -2
- package/dist/esm/websocket/WebSocketClient.js.map +2 -2
- package/dist/esm/websocket/WebSocketManager.js +68 -40
- package/dist/esm/websocket/WebSocketManager.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +19134 -9180
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
- package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
- package/dist/types/bundle-entry.d.ts +7 -12
- package/dist/types/bundle-entry.d.ts.map +1 -1
- package/dist/types/codes/Mimes.d.ts +2 -0
- package/dist/types/codes/Mimes.d.ts.map +1 -1
- package/dist/types/decorators/MethodMapping.d.ts +8 -0
- package/dist/types/decorators/MethodMapping.d.ts.map +1 -1
- package/dist/types/filters/ResourceFilter.d.ts.map +1 -1
- package/dist/types/option/HttpServerOption.d.ts +6 -2
- package/dist/types/option/HttpServerOption.d.ts.map +1 -1
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts +5 -15
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketClient.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketManager.d.ts +3 -1
- package/dist/types/websocket/WebSocketManager.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +19121 -9173
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
- package/dist/umd-bundle/websocket-client.umd.js +412 -1482
- package/dist/umd-bundle/websocket-client.umd.js.map +4 -4
- package/package.json +8 -8
- package/src/SimpleBootHttpServer.ts +37 -18
- package/src/bundle-entry.ts +12 -12
- package/src/codes/Mimes.ts +2 -0
- package/src/decorators/MethodMapping.ts +14 -7
- package/src/filters/ResourceFilter.ts +0 -1
- package/src/option/HttpServerOption.ts +4 -2
- package/src/proxy/TopicProtocolApiServiceProxy.ts +260 -275
- package/src/websocket/WebSocketClient.ts +3 -2
- package/src/websocket/WebSocketManager.ts +69 -41
|
@@ -7,11 +7,11 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
|
-
var __copyProps = (to,
|
|
11
|
-
if (
|
|
12
|
-
for (let key of __getOwnPropNames(
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
13
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () =>
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
@@ -48,12 +48,14 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
48
48
|
DEFAULT_EXPRESSION_CONFIG: () => DEFAULT_EXPRESSION_CONFIG,
|
|
49
49
|
DateUtils: () => DateUtils,
|
|
50
50
|
Ellipse: () => Ellipse,
|
|
51
|
+
EmptyError: () => EmptyError,
|
|
51
52
|
EmptyValidator: () => EmptyValidator,
|
|
52
53
|
ExcludeCheckedValidatorArray: () => ExcludeCheckedValidatorArray,
|
|
53
54
|
Expression: () => Expression,
|
|
54
55
|
Fetcher: () => Fetcher,
|
|
55
56
|
FormValidator: () => FormValidator,
|
|
56
57
|
FunctionUtils: () => FunctionUtils,
|
|
58
|
+
HashUtils: () => HashUtils,
|
|
57
59
|
HttpFetcher: () => HttpFetcher,
|
|
58
60
|
HttpJsonFetcher: () => HttpJsonFetcher,
|
|
59
61
|
HttpResponseError: () => HttpResponseError,
|
|
@@ -66,8 +68,6 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
66
68
|
LoggerLevel: () => LoggerLevel,
|
|
67
69
|
MathUtil: () => MathUtil,
|
|
68
70
|
MemoryStorage: () => MemoryStorage,
|
|
69
|
-
MessageInternal: () => internal_exports,
|
|
70
|
-
MessageOperator: () => operators_exports,
|
|
71
71
|
MultipleValidator: () => MultipleValidator,
|
|
72
72
|
NonPassValidator: () => NonPassValidator,
|
|
73
73
|
NotEmptyValidator: () => NotEmptyValidator,
|
|
@@ -121,21 +121,42 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
121
121
|
WebSocketClient: () => WebSocketClient,
|
|
122
122
|
WrapPolygons: () => WrapPolygons,
|
|
123
123
|
WrapRects: () => WrapRects,
|
|
124
|
+
concat: () => concat,
|
|
124
125
|
debounce: () => debounce,
|
|
125
126
|
debounceTimeIntervalLock: () => debounceTimeIntervalLock,
|
|
127
|
+
defer: () => defer,
|
|
128
|
+
empty: () => empty,
|
|
129
|
+
firstValueFrom: () => firstValueFrom,
|
|
130
|
+
fromArray: () => fromArray,
|
|
131
|
+
fromEvent: () => fromEvent,
|
|
132
|
+
fromPromise: () => fromPromise,
|
|
126
133
|
getExpression: () => getExpression,
|
|
134
|
+
interval: () => interval,
|
|
127
135
|
isAtRule: () => isAtRule,
|
|
128
136
|
isCssCommentItem: () => isCssCommentItem,
|
|
129
137
|
isCssDeclarationItem: () => isCssDeclarationItem,
|
|
130
138
|
isCssRuleItem: () => isCssRuleItem,
|
|
139
|
+
isDefined: () => isDefined,
|
|
131
140
|
isHttpResponseError: () => isHttpResponseError,
|
|
132
141
|
isPoint2DType: () => isPoint2DType,
|
|
133
142
|
isPoint3DType: () => isPoint3DType,
|
|
134
143
|
isRule: () => isRule,
|
|
135
144
|
isSizeType: () => isSizeType,
|
|
136
145
|
isStyleRule: () => isStyleRule,
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
lastValueFrom: () => lastValueFrom,
|
|
147
|
+
merge: () => merge,
|
|
148
|
+
never: () => never,
|
|
149
|
+
of: () => of,
|
|
150
|
+
range: () => range,
|
|
151
|
+
skip: () => skip,
|
|
152
|
+
startWith: () => startWith,
|
|
153
|
+
take: () => take,
|
|
154
|
+
takeWhile: () => takeWhile,
|
|
155
|
+
throttle: () => throttle,
|
|
156
|
+
throttleTime: () => throttleTime,
|
|
157
|
+
throwError: () => throwError,
|
|
158
|
+
timer: () => timer,
|
|
159
|
+
toPromise: () => toPromise
|
|
139
160
|
});
|
|
140
161
|
|
|
141
162
|
// ../core/dist/esm/valid/ValidUtils.js
|
|
@@ -188,11 +209,11 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
188
209
|
ValidUtils2.isNullOrUndefined = (data) => {
|
|
189
210
|
return data == null || void 0 === data;
|
|
190
211
|
};
|
|
191
|
-
ValidUtils2.
|
|
192
|
-
return typeof obj === "function" && obj.
|
|
212
|
+
ValidUtils2.isClassType = (obj) => {
|
|
213
|
+
return typeof obj === "function" && /^\s*class\s+/.test(obj.toString());
|
|
193
214
|
};
|
|
194
|
-
ValidUtils2.
|
|
195
|
-
return typeof obj === "function"
|
|
215
|
+
ValidUtils2.isFunctionType = (obj) => {
|
|
216
|
+
return typeof obj === "function";
|
|
196
217
|
};
|
|
197
218
|
ValidUtils2.isNullish = (data) => {
|
|
198
219
|
return ValidUtils2.isNotNullish(data);
|
|
@@ -341,6 +362,13 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
341
362
|
// ../core/dist/esm/array/ArrayUtils.js
|
|
342
363
|
var ArrayUtils;
|
|
343
364
|
((ArrayUtils2) => {
|
|
365
|
+
ArrayUtils2.split = (data, length) => {
|
|
366
|
+
const result = [];
|
|
367
|
+
for (let i = 0; i < data.length; i += length) {
|
|
368
|
+
result.push(data.slice(i, i + length));
|
|
369
|
+
}
|
|
370
|
+
return result;
|
|
371
|
+
};
|
|
344
372
|
ArrayUtils2.create2DArray = (rows, cols, initialValue) => {
|
|
345
373
|
const array = [];
|
|
346
374
|
for (let row = 0; row < rows; row++) {
|
|
@@ -2068,6 +2096,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2068
2096
|
this.z = z ?? 0;
|
|
2069
2097
|
}
|
|
2070
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* 성분 대입 (파괴적). 벡터 전달 시 그 성분을 복사.
|
|
2101
|
+
* @example
|
|
2102
|
+
* v.set(1, 2, 3); // v = (1, 2, 3)
|
|
2103
|
+
* v.set(otherVector); // v = other와 동일 성분
|
|
2104
|
+
*/
|
|
2071
2105
|
set(v, y = 0, z = 0) {
|
|
2072
2106
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2073
2107
|
this.set(v.x || 0, v.y || 0, v.z || 0);
|
|
@@ -2078,16 +2112,45 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2078
2112
|
}
|
|
2079
2113
|
return this;
|
|
2080
2114
|
}
|
|
2115
|
+
/**
|
|
2116
|
+
* 복사본 반환 (비파괴). 파괴적 메서드와 조합해 원본 보존용.
|
|
2117
|
+
* @example
|
|
2118
|
+
* const s = a.get(); s.add(b); // s = a+b, a는 그대로
|
|
2119
|
+
*/
|
|
2081
2120
|
get() {
|
|
2082
2121
|
return new _Vector(this.x, this.y, this.z);
|
|
2083
2122
|
}
|
|
2084
|
-
|
|
2085
|
-
|
|
2123
|
+
/**
|
|
2124
|
+
* 노름(norm). 평평한 공간(유클리드 공간)에서의 직선 거리.
|
|
2125
|
+
* - 수식: ‖v‖ = √(x² + y² + z²)
|
|
2126
|
+
* - 2D에서는 피타고라스 정리 그 자체. 3D는 두 번 적용한 것과 같음.
|
|
2127
|
+
* (바닥 대각선 √(x²+y²) → 공간 대각선 √((바닥)²+z²))
|
|
2128
|
+
* - "유클리드"는 평평한 공간의 기하학을 말함 (좌표계는 데카르트의 것, 유클리드는 좌표 없이 기하학을 세움).
|
|
2129
|
+
* 휘어진 공간(구면·쌍곡)에서는 이 공식이 성립하지 않음.
|
|
2130
|
+
* @example
|
|
2131
|
+
* new Vector(3, 4, 0).norm(); // 5
|
|
2132
|
+
* new Vector(6, 8, 0).norm(); // 10
|
|
2133
|
+
*/
|
|
2134
|
+
norm() {
|
|
2086
2135
|
const x = this.x;
|
|
2087
2136
|
const y = this.y;
|
|
2088
2137
|
const z = this.z;
|
|
2089
2138
|
return Math.sqrt(x * x + y * y + z * z);
|
|
2090
2139
|
}
|
|
2140
|
+
/**
|
|
2141
|
+
* norm()의 별칭 (p5.js 호환).
|
|
2142
|
+
* @example
|
|
2143
|
+
* new Vector(3, 4, 0).mag(); // 5
|
|
2144
|
+
*/
|
|
2145
|
+
mag() {
|
|
2146
|
+
return this.norm();
|
|
2147
|
+
}
|
|
2148
|
+
/**
|
|
2149
|
+
* 덧셈 (파괴적). 성분별 합. 기하학적으로 평행사변형의 대각선.
|
|
2150
|
+
* - 수식: a + b = (ax+bx, ay+by, az+bz)
|
|
2151
|
+
* @example
|
|
2152
|
+
* const a = new Vector(4, 2); a.add(new Vector(-2, 3)); // a = (2, 5)
|
|
2153
|
+
*/
|
|
2091
2154
|
add(v, y = 0, z = 0) {
|
|
2092
2155
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2093
2156
|
this.x += v.x;
|
|
@@ -2099,12 +2162,24 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2099
2162
|
this.z += z;
|
|
2100
2163
|
}
|
|
2101
2164
|
}
|
|
2165
|
+
/**
|
|
2166
|
+
* 덧셈 결과의 새 벡터 반환 (비파괴).
|
|
2167
|
+
* - 수식: a + b = (ax+bx, ay+by, az+bz)
|
|
2168
|
+
* @example
|
|
2169
|
+
* const s = a.toAdd(a, b); // s = a+b, a·b는 그대로
|
|
2170
|
+
*/
|
|
2102
2171
|
toAdd(v1, v2) {
|
|
2103
2172
|
return new _Vector(v1.x + v2.x, v1.y + v2.y, v1.x + v2.y);
|
|
2104
2173
|
}
|
|
2105
2174
|
// public static add(v1: Vector, v2: Vector): Vector {
|
|
2106
2175
|
// return new Vector(v1.x + v2.x, v1.y + v2.y, v1.x + v2.y);
|
|
2107
2176
|
// }
|
|
2177
|
+
/**
|
|
2178
|
+
* 뺄셈 (파괴적). a - b는 "a에서 b를 되돌리는" 벡터.
|
|
2179
|
+
* - 수식: a - b = (ax-bx, ay-by, az-bz)
|
|
2180
|
+
* @example
|
|
2181
|
+
* const a = new Vector(4, 2); a.sub(new Vector(1, 1)); // a = (3, 1)
|
|
2182
|
+
*/
|
|
2108
2183
|
sub(v, y = 0, z = 0) {
|
|
2109
2184
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2110
2185
|
this.x -= v.x;
|
|
@@ -2116,6 +2191,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2116
2191
|
this.z -= z;
|
|
2117
2192
|
}
|
|
2118
2193
|
}
|
|
2194
|
+
/**
|
|
2195
|
+
* 뺄셈 결과의 새 벡터 반환 (비파괴).
|
|
2196
|
+
* - 수식: a - b = (ax-bx, ay-by, az-bz)
|
|
2197
|
+
* @example
|
|
2198
|
+
* const d = a.toSub(b); // d = a-b, a·b는 그대로
|
|
2199
|
+
*/
|
|
2119
2200
|
toSub(v2) {
|
|
2120
2201
|
const v1 = this;
|
|
2121
2202
|
return new _Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
|
|
@@ -2124,6 +2205,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2124
2205
|
// public static sub(v1: Vector, v2: Vector): Vector {
|
|
2125
2206
|
// return new Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
|
|
2126
2207
|
// }
|
|
2208
|
+
/**
|
|
2209
|
+
* 스칼라배 또는 성분별 곱 (파괴적). 스칼라 k>1이면 늘어나고, 0<k<1이면 줄어듦. k<0이면 반대 방향.
|
|
2210
|
+
* - 수식(스칼라): k·v = (k·x, k·y, k·z)
|
|
2211
|
+
* @example
|
|
2212
|
+
* const v = new Vector(1, 2); v.mult(3); // v = (3, 6)
|
|
2213
|
+
*/
|
|
2127
2214
|
mult(v) {
|
|
2128
2215
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2129
2216
|
this.x *= v.x;
|
|
@@ -2136,6 +2223,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2136
2223
|
}
|
|
2137
2224
|
return this;
|
|
2138
2225
|
}
|
|
2226
|
+
/**
|
|
2227
|
+
* 성분별 곱 결과의 새 벡터 반환 (비파괴).
|
|
2228
|
+
* - 수식: (ax·bx, ay·by, az·bz)
|
|
2229
|
+
* @example
|
|
2230
|
+
* const m = a.toMult(b); // m = 성분별 곱, a·b는 그대로
|
|
2231
|
+
*/
|
|
2139
2232
|
toMult(v2) {
|
|
2140
2233
|
const v1 = this;
|
|
2141
2234
|
return new _Vector(v1.x *= v2.x, v1.y *= v2.y, v1.z *= v2.z);
|
|
@@ -2143,6 +2236,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2143
2236
|
// public static mult(v1: Vector, v2: Vector) {
|
|
2144
2237
|
// return new Vector(v1.x *= v2.x, v1.y *= v2.y, v1.z *= v2.z);
|
|
2145
2238
|
// }
|
|
2239
|
+
/**
|
|
2240
|
+
* 스칼라 나눗셈 또는 성분별 나눗셈 (파괴적). 정규화의 핵심 연산.
|
|
2241
|
+
* - 수식(스칼라): v/k = (x/k, y/k, z/k)
|
|
2242
|
+
* @example
|
|
2243
|
+
* const v = new Vector(6, 8); v.div(2); // v = (3, 4)
|
|
2244
|
+
*/
|
|
2146
2245
|
div(v) {
|
|
2147
2246
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2148
2247
|
this.x /= v.x;
|
|
@@ -2155,6 +2254,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2155
2254
|
}
|
|
2156
2255
|
return this;
|
|
2157
2256
|
}
|
|
2257
|
+
/**
|
|
2258
|
+
* 스칼라 나눗셈 결과의 새 벡터 반환 (비파괴).
|
|
2259
|
+
* - 수식: v/k = (x/k, y/k, z/k)
|
|
2260
|
+
* @example
|
|
2261
|
+
* const h = v.toDiv(2); // h = v/2, v는 그대로
|
|
2262
|
+
*/
|
|
2158
2263
|
toDiv(d) {
|
|
2159
2264
|
const v = this;
|
|
2160
2265
|
const rv = v.get();
|
|
@@ -2170,10 +2275,22 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2170
2275
|
// rv.z /= d;
|
|
2171
2276
|
// return rv;
|
|
2172
2277
|
// }
|
|
2278
|
+
/**
|
|
2279
|
+
* 두 점(벡터) 사이 거리. 차 벡터의 크기.
|
|
2280
|
+
* - 수식: d = √((dx)² + (dy)² + (dz)²)
|
|
2281
|
+
* @example
|
|
2282
|
+
* new Vector(0, 0).dist(new Vector(3, 4)); // 5
|
|
2283
|
+
*/
|
|
2173
2284
|
dist(v) {
|
|
2174
2285
|
const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
|
|
2175
2286
|
return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
2176
2287
|
}
|
|
2288
|
+
/**
|
|
2289
|
+
* 두 점(벡터) 사이 거리 (toDist는 dist와 동일, 비파괴).
|
|
2290
|
+
* - 수식: d = √((dx)² + (dy)² + (dz)²)
|
|
2291
|
+
* @example
|
|
2292
|
+
* a.toDist(b); // a와 b 사이 거리
|
|
2293
|
+
*/
|
|
2177
2294
|
toDist(v2) {
|
|
2178
2295
|
const v1 = this;
|
|
2179
2296
|
const dx = v1.x - v2.x, dy = v1.y - v2.y, dz = v1.z - v2.z;
|
|
@@ -2185,36 +2302,90 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2185
2302
|
// dz = v1.z - v2.z;
|
|
2186
2303
|
// return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
2187
2304
|
// }
|
|
2188
|
-
|
|
2305
|
+
/**
|
|
2306
|
+
* 내적(dot product). 두 벡터가 같은 방향을 향하는 정도.
|
|
2307
|
+
* - 수식: a·b = ax·bx + ay·by + az·bz = |a||b|cosθ
|
|
2308
|
+
* - θ=90°면 0(직교), 0°면 최대(같은 방향).
|
|
2309
|
+
* - 벡터 전달 시 y·z 생략 가능, 스칼라(x) 전달 시 y·z와 함께 사용.
|
|
2310
|
+
* @example
|
|
2311
|
+
* new Vector(5, 12).dot(new Vector(-5, 12)); // -25+144 = 119
|
|
2312
|
+
* new Vector(1, 0).dot(new Vector(0, 1)); // 0 (직각)
|
|
2313
|
+
* new Vector(1, 2).dot(3, 4); // 1*3+2*4 = 11
|
|
2314
|
+
*/
|
|
2315
|
+
dot(v, y = 0, z = 0) {
|
|
2189
2316
|
if (v instanceof _Vector || v instanceof Point3D) {
|
|
2190
2317
|
return this.x * v.x + this.y * v.y + this.z * v.z;
|
|
2191
2318
|
}
|
|
2192
2319
|
;
|
|
2193
2320
|
return this.x * v + this.y * y + this.z * z;
|
|
2194
2321
|
}
|
|
2322
|
+
/**
|
|
2323
|
+
* 외적(cross product). 두 벡터에 수직인 벡터. 오른손 법칙 방향.
|
|
2324
|
+
* - 수식: a×b = (ay·bz − az·by, az·bx − ax·bz, ax·by − ay·bx)
|
|
2325
|
+
* - 2D에서는 z값 = ax·by − ay·bx (부호 있는 면적, 회전 방향 판정용).
|
|
2326
|
+
* @example
|
|
2327
|
+
* new Vector(1, 0, 0).cross(new Vector(0, 1, 0)); // (0, 0, 1)
|
|
2328
|
+
*/
|
|
2195
2329
|
cross(v) {
|
|
2196
2330
|
const x = this.x, y = this.y, z = this.z;
|
|
2197
2331
|
return new _Vector(y * v.z - v.y * z, z * v.x - v.z * x, x * v.y - v.x * y);
|
|
2198
2332
|
}
|
|
2333
|
+
/**
|
|
2334
|
+
* 정규화 (파괴적). 방향은 그대로, 크기를 1로. 단위벡터 v̂ 생성.
|
|
2335
|
+
* - 수식: v̂ = v / |v|
|
|
2336
|
+
* - 영벡터(|v|=0)는 0으로 나누지 않고 그대로 둠.
|
|
2337
|
+
* @example
|
|
2338
|
+
* const v = new Vector(6, 8); v.normalize(); // v = (0.6, 0.8), |v| = 1
|
|
2339
|
+
*/
|
|
2199
2340
|
normalize() {
|
|
2200
|
-
const m = this.
|
|
2341
|
+
const m = this.norm();
|
|
2201
2342
|
if (m > 0) this.div(m);
|
|
2202
2343
|
}
|
|
2344
|
+
/**
|
|
2345
|
+
* 크기 상한 (파괴적). 속도가 high를 넘으면 방향 유지한 채 high로 자름. 물리 시뮬레이션 최고속도용.
|
|
2346
|
+
* - 수식: |v| > high → v = v̂ · high
|
|
2347
|
+
* @example
|
|
2348
|
+
* const v = new Vector(6, 8); v.limit(5); // |v|=10 → 5, v = (3, 4)
|
|
2349
|
+
*/
|
|
2203
2350
|
limit(high) {
|
|
2204
|
-
if (this.
|
|
2351
|
+
if (this.norm() > high) {
|
|
2205
2352
|
this.normalize();
|
|
2206
2353
|
this.mult(high);
|
|
2207
2354
|
}
|
|
2208
2355
|
}
|
|
2356
|
+
/**
|
|
2357
|
+
* 2D 방향각. +x축 기준 반시계 방향 라디안 (-π ~ π).
|
|
2358
|
+
* - 수식: θ = atan2(y, x)
|
|
2359
|
+
* @example
|
|
2360
|
+
* new Vector(1, 1).heading2D(); // π/4 (45°)
|
|
2361
|
+
* new Vector(-1, 0).heading2D(); // π (180°)
|
|
2362
|
+
*/
|
|
2209
2363
|
heading2D() {
|
|
2210
2364
|
return -Math.atan2(-this.y, this.x);
|
|
2211
2365
|
}
|
|
2366
|
+
/**
|
|
2367
|
+
* 무작위 방향 단위벡터 반환 (새 Vector, 자신은 변경 안 함).
|
|
2368
|
+
* @example
|
|
2369
|
+
* const r = new Vector().random2D(); // |r| = 1, 방향 랜덤
|
|
2370
|
+
*/
|
|
2212
2371
|
random2D() {
|
|
2213
2372
|
return this.fromAngle(Math.random() * (2 * Math.PI));
|
|
2214
2373
|
}
|
|
2374
|
+
/**
|
|
2375
|
+
* 각도→벡터. 각도 θ, 길이 L인 2D 벡터 반환 (새 Vector).
|
|
2376
|
+
* - 수식: (L·cosθ, L·sinθ, 0)
|
|
2377
|
+
* @example
|
|
2378
|
+
* new Vector().fromAngle(Math.PI / 3, 2); // (1, 1.73, 0)
|
|
2379
|
+
*/
|
|
2215
2380
|
fromAngle(angle, length = 1) {
|
|
2216
2381
|
return new _Vector(length * Math.cos(angle), length * Math.sin(angle), 0);
|
|
2217
2382
|
}
|
|
2383
|
+
/**
|
|
2384
|
+
* 구면좌표→3D 벡터 (새 Vector 반환, p5.js 컨벤션).
|
|
2385
|
+
* - 수식: (L·sinθ·sinφ, −L·cosθ, L·sinθ·cosφ)
|
|
2386
|
+
* @example
|
|
2387
|
+
* new Vector().fromAngles(Math.PI / 2, Math.PI / 2, 1); // (1, 0, 0)
|
|
2388
|
+
*/
|
|
2218
2389
|
fromAngles(theta, phi, length = 1) {
|
|
2219
2390
|
const cosPhi = Math.cos(phi);
|
|
2220
2391
|
const sinPhi = Math.sin(phi);
|
|
@@ -2226,18 +2397,43 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
2226
2397
|
length * sinTheta * cosPhi
|
|
2227
2398
|
);
|
|
2228
2399
|
}
|
|
2400
|
+
/**
|
|
2401
|
+
* 성분 배열 반환. [x, y, z] 순서.
|
|
2402
|
+
* @example
|
|
2403
|
+
* new Vector(1, 2, 3).array(); // [1, 2, 3]
|
|
2404
|
+
*/
|
|
2229
2405
|
array() {
|
|
2230
2406
|
return [this.x, this.y, this.z];
|
|
2231
2407
|
}
|
|
2408
|
+
/**
|
|
2409
|
+
* Point3D로 변환 (위치 의미로 바꿀 때).
|
|
2410
|
+
* @example
|
|
2411
|
+
* new Vector(1, 2, 3).toPoint3D(); // Point3D(1, 2, 3)
|
|
2412
|
+
*/
|
|
2232
2413
|
toPoint3D() {
|
|
2233
2414
|
return new Point3D(this.x, this.y, this.z);
|
|
2234
2415
|
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Point2D로 변환 (z 버림).
|
|
2418
|
+
* @example
|
|
2419
|
+
* new Vector(1, 2, 3).toPoint2D(); // Point2D(1, 2)
|
|
2420
|
+
*/
|
|
2235
2421
|
toPoint2D() {
|
|
2236
2422
|
return new Point2D(this.x, this.y);
|
|
2237
2423
|
}
|
|
2424
|
+
/**
|
|
2425
|
+
* 복사본 반환 (get()과 동일, 비파괴).
|
|
2426
|
+
* @example
|
|
2427
|
+
* const c = v.copy(); // v와 같은 성분의 새 벡터
|
|
2428
|
+
*/
|
|
2238
2429
|
copy() {
|
|
2239
2430
|
return new _Vector(this.x, this.y, this.z);
|
|
2240
2431
|
}
|
|
2432
|
+
/**
|
|
2433
|
+
* 문자열 표현. "[x, y, z]" 형식.
|
|
2434
|
+
* @example
|
|
2435
|
+
* new Vector(1, 2).toString(); // "[1, 2, 0]"
|
|
2436
|
+
*/
|
|
2241
2437
|
toString() {
|
|
2242
2438
|
return "[" + this.x + ", " + this.y + ", " + this.z + "]";
|
|
2243
2439
|
}
|
|
@@ -3111,6 +3307,10 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3111
3307
|
const rotatedY = translatedX * Math.sin(angleInRadians) + translatedY * Math.cos(angleInRadians);
|
|
3112
3308
|
return new Point2D(rotatedX + center.x, rotatedY + center.y);
|
|
3113
3309
|
};
|
|
3310
|
+
MathUtil2.quadraticBezier = (p0, p1, p2, t) => {
|
|
3311
|
+
const mt = 1 - t;
|
|
3312
|
+
return mt * mt * p0 + 2 * mt * t * p1 + t * t * p2;
|
|
3313
|
+
};
|
|
3114
3314
|
})(MathUtil || (MathUtil = {}));
|
|
3115
3315
|
|
|
3116
3316
|
// ../core/dist/esm/convert/ConvertUtils.js
|
|
@@ -3119,10 +3319,10 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3119
3319
|
ConvertUtils2.objToGetURL = (obj) => {
|
|
3120
3320
|
return Object.keys(obj).reduce((prev, key, i) => `${prev}${i !== 0 ? "&" : ""}${key}=${obj[key]}`, "");
|
|
3121
3321
|
};
|
|
3122
|
-
ConvertUtils2.mapToJson = (
|
|
3322
|
+
ConvertUtils2.mapToJson = (map) => {
|
|
3123
3323
|
return JSON.stringify(
|
|
3124
3324
|
Array.from(
|
|
3125
|
-
|
|
3325
|
+
map.entries()
|
|
3126
3326
|
).reduce((o, [key, value]) => {
|
|
3127
3327
|
o[key] = value;
|
|
3128
3328
|
return o;
|
|
@@ -3168,9 +3368,9 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3168
3368
|
});
|
|
3169
3369
|
return mp;
|
|
3170
3370
|
};
|
|
3171
|
-
ConvertUtils2.mapToObj = (
|
|
3371
|
+
ConvertUtils2.mapToObj = (map) => {
|
|
3172
3372
|
const obj = {};
|
|
3173
|
-
|
|
3373
|
+
map.forEach((v, k) => {
|
|
3174
3374
|
obj[k] = v;
|
|
3175
3375
|
});
|
|
3176
3376
|
return obj;
|
|
@@ -3223,8 +3423,8 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3223
3423
|
return Object.fromEntries(obj);
|
|
3224
3424
|
} else {
|
|
3225
3425
|
if (ValidUtils.isMap(obj)) {
|
|
3226
|
-
const
|
|
3227
|
-
obj = ConvertUtils2.mapToObj(
|
|
3426
|
+
const map = obj;
|
|
3427
|
+
obj = ConvertUtils2.mapToObj(map);
|
|
3228
3428
|
}
|
|
3229
3429
|
if (ValidUtils.isArray(obj)) {
|
|
3230
3430
|
const arr = obj;
|
|
@@ -3479,17 +3679,17 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3479
3679
|
return result;
|
|
3480
3680
|
};
|
|
3481
3681
|
ConvertUtils2.groupByMap = (array, keySelector) => {
|
|
3482
|
-
return array.reduce((
|
|
3682
|
+
return array.reduce((map, item) => {
|
|
3483
3683
|
const key = keySelector(item);
|
|
3484
|
-
const group =
|
|
3684
|
+
const group = map.get(key) || [];
|
|
3485
3685
|
group.push(item);
|
|
3486
|
-
|
|
3487
|
-
return
|
|
3686
|
+
map.set(key, group);
|
|
3687
|
+
return map;
|
|
3488
3688
|
}, /* @__PURE__ */ new Map());
|
|
3489
3689
|
};
|
|
3490
3690
|
ConvertUtils2.groupByObject = (array, keySelector) => {
|
|
3491
|
-
const
|
|
3492
|
-
return Object.fromEntries(
|
|
3691
|
+
const map = (0, ConvertUtils2.groupByMap)(array, keySelector);
|
|
3692
|
+
return Object.fromEntries(map);
|
|
3493
3693
|
};
|
|
3494
3694
|
ConvertUtils2.toURLSearchParams = (data) => {
|
|
3495
3695
|
const searchParams = new URLSearchParams();
|
|
@@ -3979,32 +4179,6 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
3979
4179
|
}
|
|
3980
4180
|
};
|
|
3981
4181
|
|
|
3982
|
-
// ../core/dist/esm/message/internal/index.js
|
|
3983
|
-
var internal_exports = {};
|
|
3984
|
-
__export(internal_exports, {
|
|
3985
|
-
EmptyError: () => EmptyError,
|
|
3986
|
-
concat: () => concat,
|
|
3987
|
-
defer: () => defer,
|
|
3988
|
-
empty: () => empty,
|
|
3989
|
-
firstValueFrom: () => firstValueFrom,
|
|
3990
|
-
fromArray: () => fromArray,
|
|
3991
|
-
fromEvent: () => fromEvent,
|
|
3992
|
-
fromPromise: () => fromPromise,
|
|
3993
|
-
interval: () => interval,
|
|
3994
|
-
lastValueFrom: () => lastValueFrom,
|
|
3995
|
-
merge: () => merge,
|
|
3996
|
-
never: () => never,
|
|
3997
|
-
of: () => of,
|
|
3998
|
-
range: () => range,
|
|
3999
|
-
skip: () => skip,
|
|
4000
|
-
startWith: () => startWith,
|
|
4001
|
-
take: () => take,
|
|
4002
|
-
takeWhile: () => takeWhile,
|
|
4003
|
-
throwError: () => throwError,
|
|
4004
|
-
timer: () => timer,
|
|
4005
|
-
toPromise: () => toPromise
|
|
4006
|
-
});
|
|
4007
|
-
|
|
4008
4182
|
// ../core/dist/esm/message/internal/interval.js
|
|
4009
4183
|
function interval(period = 0) {
|
|
4010
4184
|
if (period < 0) {
|
|
@@ -4218,1176 +4392,23 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
4218
4392
|
return observable.subscribe({
|
|
4219
4393
|
next: (value) => subscriber.next(value),
|
|
4220
4394
|
error: (err) => subscriber.error(err),
|
|
4221
|
-
complete: () => subscriber.complete()
|
|
4222
|
-
});
|
|
4223
|
-
}
|
|
4224
|
-
});
|
|
4225
|
-
}
|
|
4226
|
-
|
|
4227
|
-
// ../core/dist/esm/message/internal/skip.js
|
|
4228
|
-
function skip(count) {
|
|
4229
|
-
return (source) => {
|
|
4230
|
-
return new Observable((subscriber) => {
|
|
4231
|
-
let skipped = 0;
|
|
4232
|
-
const subscription = source.subscribe({
|
|
4233
|
-
next: (value) => {
|
|
4234
|
-
if (skipped < count) {
|
|
4235
|
-
skipped++;
|
|
4236
|
-
} else {
|
|
4237
|
-
subscriber.next(value);
|
|
4238
|
-
}
|
|
4239
|
-
},
|
|
4240
|
-
error: (err) => {
|
|
4241
|
-
subscriber.error(err);
|
|
4242
|
-
},
|
|
4243
|
-
complete: () => {
|
|
4244
|
-
subscriber.complete();
|
|
4245
|
-
}
|
|
4246
|
-
});
|
|
4247
|
-
return subscription;
|
|
4248
|
-
});
|
|
4249
|
-
};
|
|
4250
|
-
}
|
|
4251
|
-
|
|
4252
|
-
// ../core/dist/esm/message/internal/takeWhile.js
|
|
4253
|
-
function takeWhile(predicate, inclusive = false) {
|
|
4254
|
-
return (source) => {
|
|
4255
|
-
return new Observable((subscriber) => {
|
|
4256
|
-
let index = 0;
|
|
4257
|
-
const subscription = source.subscribe({
|
|
4258
|
-
next: (value) => {
|
|
4259
|
-
const result = predicate(value, index++);
|
|
4260
|
-
if (result) {
|
|
4261
|
-
subscriber.next(value);
|
|
4262
|
-
} else {
|
|
4263
|
-
if (inclusive) {
|
|
4264
|
-
subscriber.next(value);
|
|
4265
|
-
}
|
|
4266
|
-
subscriber.complete();
|
|
4267
|
-
}
|
|
4268
|
-
},
|
|
4269
|
-
error: (err) => {
|
|
4270
|
-
subscriber.error(err);
|
|
4271
|
-
},
|
|
4272
|
-
complete: () => {
|
|
4273
|
-
subscriber.complete();
|
|
4274
|
-
}
|
|
4275
|
-
});
|
|
4276
|
-
return subscription;
|
|
4277
|
-
});
|
|
4278
|
-
};
|
|
4279
|
-
}
|
|
4280
|
-
|
|
4281
|
-
// ../core/dist/esm/message/internal/startWith.js
|
|
4282
|
-
function startWith(...values) {
|
|
4283
|
-
return (source) => {
|
|
4284
|
-
return new Observable((subscriber) => {
|
|
4285
|
-
for (const value of values) {
|
|
4286
|
-
subscriber.next(value);
|
|
4287
|
-
}
|
|
4288
|
-
const subscription = source.subscribe({
|
|
4289
|
-
next: (value) => {
|
|
4290
|
-
subscriber.next(value);
|
|
4291
|
-
},
|
|
4292
|
-
error: (err) => {
|
|
4293
|
-
subscriber.error(err);
|
|
4294
|
-
},
|
|
4295
|
-
complete: () => {
|
|
4296
|
-
subscriber.complete();
|
|
4297
|
-
}
|
|
4298
|
-
});
|
|
4299
|
-
return subscription;
|
|
4300
|
-
});
|
|
4301
|
-
};
|
|
4302
|
-
}
|
|
4303
|
-
|
|
4304
|
-
// ../core/dist/esm/message/internal/concat.js
|
|
4305
|
-
function concat(...observables) {
|
|
4306
|
-
return new Observable((subscriber) => {
|
|
4307
|
-
let currentIndex = 0;
|
|
4308
|
-
let currentSubscription;
|
|
4309
|
-
function subscribeToNext() {
|
|
4310
|
-
if (currentIndex >= observables.length) {
|
|
4311
|
-
subscriber.complete();
|
|
4312
|
-
return;
|
|
4313
|
-
}
|
|
4314
|
-
const currentObservable = observables[currentIndex++];
|
|
4315
|
-
currentSubscription = currentObservable.subscribe({
|
|
4316
|
-
next: (value) => {
|
|
4317
|
-
subscriber.next(value);
|
|
4318
|
-
},
|
|
4319
|
-
error: (err) => {
|
|
4320
|
-
subscriber.error(err);
|
|
4321
|
-
},
|
|
4322
|
-
complete: () => {
|
|
4323
|
-
subscribeToNext();
|
|
4324
|
-
}
|
|
4325
|
-
});
|
|
4326
|
-
}
|
|
4327
|
-
subscribeToNext();
|
|
4328
|
-
return () => {
|
|
4329
|
-
if (currentSubscription) {
|
|
4330
|
-
currentSubscription.unsubscribe();
|
|
4331
|
-
}
|
|
4332
|
-
};
|
|
4333
|
-
});
|
|
4334
|
-
}
|
|
4335
|
-
|
|
4336
|
-
// ../core/dist/esm/message/internal/merge.js
|
|
4337
|
-
function merge(...observables) {
|
|
4338
|
-
return new Observable((subscriber) => {
|
|
4339
|
-
if (observables.length === 0) {
|
|
4340
|
-
subscriber.complete();
|
|
4341
|
-
return;
|
|
4342
|
-
}
|
|
4343
|
-
let completedCount = 0;
|
|
4344
|
-
const subscriptions = [];
|
|
4345
|
-
for (const observable of observables) {
|
|
4346
|
-
const subscription = observable.subscribe({
|
|
4347
|
-
next: (value) => {
|
|
4348
|
-
subscriber.next(value);
|
|
4349
|
-
},
|
|
4350
|
-
error: (err) => {
|
|
4351
|
-
subscriber.error(err);
|
|
4352
|
-
},
|
|
4353
|
-
complete: () => {
|
|
4354
|
-
completedCount++;
|
|
4355
|
-
if (completedCount === observables.length) {
|
|
4356
|
-
subscriber.complete();
|
|
4357
|
-
}
|
|
4358
|
-
}
|
|
4359
|
-
});
|
|
4360
|
-
subscriptions.push(subscription);
|
|
4361
|
-
}
|
|
4362
|
-
return () => {
|
|
4363
|
-
subscriptions.forEach((sub) => sub.unsubscribe());
|
|
4364
|
-
};
|
|
4365
|
-
});
|
|
4366
|
-
}
|
|
4367
|
-
|
|
4368
|
-
// ../core/dist/esm/message/internal/fromEvent.js
|
|
4369
|
-
function fromEvent(target, eventName) {
|
|
4370
|
-
return new Observable((subscriber) => {
|
|
4371
|
-
const handler = (event) => {
|
|
4372
|
-
subscriber.next(event);
|
|
4373
|
-
};
|
|
4374
|
-
target.addEventListener(eventName, handler);
|
|
4375
|
-
return () => {
|
|
4376
|
-
target.removeEventListener(eventName, handler);
|
|
4377
|
-
};
|
|
4378
|
-
});
|
|
4379
|
-
}
|
|
4380
|
-
|
|
4381
|
-
// ../core/dist/esm/message/internal/toPromise.js
|
|
4382
|
-
function toPromise(source) {
|
|
4383
|
-
return new Promise((resolve, reject) => {
|
|
4384
|
-
let _hasValue = false;
|
|
4385
|
-
let _value;
|
|
4386
|
-
source.subscribe({
|
|
4387
|
-
next: (value) => {
|
|
4388
|
-
_value = value;
|
|
4389
|
-
_hasValue = true;
|
|
4390
|
-
},
|
|
4391
|
-
error: reject,
|
|
4392
|
-
complete: () => {
|
|
4393
|
-
if (_hasValue) {
|
|
4394
|
-
resolve(_value);
|
|
4395
|
-
} else {
|
|
4396
|
-
reject(new EmptyError());
|
|
4397
|
-
}
|
|
4398
|
-
}
|
|
4399
|
-
});
|
|
4400
|
-
});
|
|
4401
|
-
}
|
|
4402
|
-
|
|
4403
|
-
// ../core/dist/esm/message/operators/index.js
|
|
4404
|
-
var operators_exports = {};
|
|
4405
|
-
__export(operators_exports, {
|
|
4406
|
-
EmptyError: () => EmptyError2,
|
|
4407
|
-
SequenceError: () => SequenceError,
|
|
4408
|
-
TimeoutError: () => TimeoutError,
|
|
4409
|
-
bufferTime: () => bufferTime,
|
|
4410
|
-
catchError: () => catchError,
|
|
4411
|
-
concatMap: () => concatMap,
|
|
4412
|
-
debounceTime: () => debounceTime,
|
|
4413
|
-
delay: () => delay,
|
|
4414
|
-
distinctUntilChanged: () => distinctUntilChanged,
|
|
4415
|
-
filter: () => filter,
|
|
4416
|
-
finalize: () => finalize,
|
|
4417
|
-
find: () => find,
|
|
4418
|
-
first: () => first,
|
|
4419
|
-
from: () => from,
|
|
4420
|
-
interval: () => interval2,
|
|
4421
|
-
map: () => map,
|
|
4422
|
-
mergeMap: () => mergeMap,
|
|
4423
|
-
reduce: () => reduce,
|
|
4424
|
-
retry: () => retry,
|
|
4425
|
-
scan: () => scan,
|
|
4426
|
-
share: () => share,
|
|
4427
|
-
single: () => single,
|
|
4428
|
-
skip: () => skip2,
|
|
4429
|
-
skipWhile: () => skipWhile,
|
|
4430
|
-
switchMap: () => switchMap,
|
|
4431
|
-
take: () => take2,
|
|
4432
|
-
takeLast: () => takeLast,
|
|
4433
|
-
takeUntil: () => takeUntil,
|
|
4434
|
-
takeWhile: () => takeWhile2,
|
|
4435
|
-
tap: () => tap,
|
|
4436
|
-
throttle: () => throttle,
|
|
4437
|
-
timeout: () => timeout
|
|
4438
|
-
});
|
|
4439
|
-
|
|
4440
|
-
// ../core/dist/esm/message/operators/bufferTime.js
|
|
4441
|
-
function bufferTime(bufferTimeSpan, config) {
|
|
4442
|
-
return (source) => {
|
|
4443
|
-
return new Observable((subscriber) => {
|
|
4444
|
-
const bufferCreationInterval = config?.bufferCreationInterval;
|
|
4445
|
-
const maxBufferSize = config?.maxBufferSize;
|
|
4446
|
-
const skipEmpty = config?.skipEmpty ?? false;
|
|
4447
|
-
const setIntervalFn = config?.setInterval || setInterval;
|
|
4448
|
-
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
4449
|
-
const clearIntervalFn = config?.clearInterval || clearInterval;
|
|
4450
|
-
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
4451
|
-
if (bufferCreationInterval === void 0 || bufferCreationInterval === null) {
|
|
4452
|
-
let buffer = [];
|
|
4453
|
-
const intervalId = setIntervalFn(() => {
|
|
4454
|
-
if (!skipEmpty || buffer.length > 0) {
|
|
4455
|
-
subscriber.next(buffer);
|
|
4456
|
-
}
|
|
4457
|
-
buffer = [];
|
|
4458
|
-
}, bufferTimeSpan);
|
|
4459
|
-
const sourceSubscription2 = source.subscribe({
|
|
4460
|
-
next: (value) => {
|
|
4461
|
-
buffer.push(value);
|
|
4462
|
-
if (maxBufferSize && buffer.length >= maxBufferSize) {
|
|
4463
|
-
subscriber.next(buffer);
|
|
4464
|
-
buffer = [];
|
|
4465
|
-
}
|
|
4466
|
-
},
|
|
4467
|
-
error: (err) => {
|
|
4468
|
-
subscriber.error(err);
|
|
4469
|
-
clearIntervalFn(intervalId);
|
|
4470
|
-
},
|
|
4471
|
-
complete: () => {
|
|
4472
|
-
if (!skipEmpty || buffer.length > 0) {
|
|
4473
|
-
subscriber.next(buffer);
|
|
4474
|
-
}
|
|
4475
|
-
subscriber.complete();
|
|
4476
|
-
clearIntervalFn(intervalId);
|
|
4477
|
-
}
|
|
4478
|
-
});
|
|
4479
|
-
return () => {
|
|
4480
|
-
sourceSubscription2.unsubscribe();
|
|
4481
|
-
clearIntervalFn(intervalId);
|
|
4482
|
-
};
|
|
4483
|
-
}
|
|
4484
|
-
const buffers = [];
|
|
4485
|
-
let creationIntervalId;
|
|
4486
|
-
const createBuffer = () => {
|
|
4487
|
-
const newBuffer = [];
|
|
4488
|
-
const timeoutId = setTimeoutFn(() => {
|
|
4489
|
-
const index = buffers.findIndex((b) => b.timeoutId === timeoutId);
|
|
4490
|
-
if (index !== -1) {
|
|
4491
|
-
const [removed] = buffers.splice(index, 1);
|
|
4492
|
-
if (!skipEmpty || removed.buffer.length > 0) {
|
|
4493
|
-
subscriber.next(removed.buffer);
|
|
4494
|
-
}
|
|
4495
|
-
}
|
|
4496
|
-
}, bufferTimeSpan);
|
|
4497
|
-
buffers.push({ buffer: newBuffer, timeoutId });
|
|
4498
|
-
};
|
|
4499
|
-
createBuffer();
|
|
4500
|
-
creationIntervalId = setIntervalFn(() => {
|
|
4501
|
-
createBuffer();
|
|
4502
|
-
}, bufferCreationInterval);
|
|
4503
|
-
const sourceSubscription = source.subscribe({
|
|
4504
|
-
next: (value) => {
|
|
4505
|
-
for (const bufferObj of buffers) {
|
|
4506
|
-
bufferObj.buffer.push(value);
|
|
4507
|
-
if (maxBufferSize && bufferObj.buffer.length >= maxBufferSize) {
|
|
4508
|
-
const index = buffers.indexOf(bufferObj);
|
|
4509
|
-
if (index !== -1) {
|
|
4510
|
-
buffers.splice(index, 1);
|
|
4511
|
-
clearTimeoutFn(bufferObj.timeoutId);
|
|
4512
|
-
subscriber.next(bufferObj.buffer);
|
|
4513
|
-
}
|
|
4514
|
-
}
|
|
4515
|
-
}
|
|
4516
|
-
},
|
|
4517
|
-
error: (err) => {
|
|
4518
|
-
subscriber.error(err);
|
|
4519
|
-
clearIntervalFn(creationIntervalId);
|
|
4520
|
-
buffers.forEach((b) => clearTimeoutFn(b.timeoutId));
|
|
4521
|
-
},
|
|
4522
|
-
complete: () => {
|
|
4523
|
-
clearIntervalFn(creationIntervalId);
|
|
4524
|
-
buffers.forEach((b) => {
|
|
4525
|
-
clearTimeoutFn(b.timeoutId);
|
|
4526
|
-
if (!skipEmpty || b.buffer.length > 0) {
|
|
4527
|
-
subscriber.next(b.buffer);
|
|
4528
|
-
}
|
|
4529
|
-
});
|
|
4530
|
-
subscriber.complete();
|
|
4531
|
-
}
|
|
4532
|
-
});
|
|
4533
|
-
return () => {
|
|
4534
|
-
sourceSubscription.unsubscribe();
|
|
4535
|
-
clearIntervalFn(creationIntervalId);
|
|
4536
|
-
buffers.forEach((b) => clearTimeoutFn(b.timeoutId));
|
|
4537
|
-
};
|
|
4538
|
-
});
|
|
4539
|
-
};
|
|
4540
|
-
}
|
|
4541
|
-
|
|
4542
|
-
// ../core/dist/esm/message/operators/debounceTime.js
|
|
4543
|
-
function debounceTime(duration, config) {
|
|
4544
|
-
return (source) => {
|
|
4545
|
-
return new Observable((subscriber) => {
|
|
4546
|
-
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
4547
|
-
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
4548
|
-
let timeoutId = null;
|
|
4549
|
-
let lastValue;
|
|
4550
|
-
let hasValue = false;
|
|
4551
|
-
const subscription = source.subscribe({
|
|
4552
|
-
next: (value) => {
|
|
4553
|
-
clearTimeoutFn(timeoutId);
|
|
4554
|
-
lastValue = value;
|
|
4555
|
-
hasValue = true;
|
|
4556
|
-
timeoutId = setTimeoutFn(() => {
|
|
4557
|
-
if (hasValue) {
|
|
4558
|
-
subscriber.next(lastValue);
|
|
4559
|
-
hasValue = false;
|
|
4560
|
-
}
|
|
4561
|
-
}, duration);
|
|
4562
|
-
},
|
|
4563
|
-
error: (err) => {
|
|
4564
|
-
clearTimeoutFn(timeoutId);
|
|
4565
|
-
subscriber.error(err);
|
|
4566
|
-
},
|
|
4567
|
-
complete: () => {
|
|
4568
|
-
clearTimeoutFn(timeoutId);
|
|
4569
|
-
if (hasValue) {
|
|
4570
|
-
subscriber.next(lastValue);
|
|
4571
|
-
}
|
|
4572
|
-
subscriber.complete();
|
|
4573
|
-
}
|
|
4574
|
-
});
|
|
4575
|
-
return subscription;
|
|
4576
|
-
});
|
|
4577
|
-
};
|
|
4578
|
-
}
|
|
4579
|
-
|
|
4580
|
-
// ../core/dist/esm/message/operators/distinctUntilChanged.js
|
|
4581
|
-
function distinctUntilChanged(comparator) {
|
|
4582
|
-
return (source) => {
|
|
4583
|
-
return new Observable((subscriber) => {
|
|
4584
|
-
let hasValue = false;
|
|
4585
|
-
let previousValue;
|
|
4586
|
-
const subscription = source.subscribe({
|
|
4587
|
-
next: (value) => {
|
|
4588
|
-
const areEqual = hasValue ? comparator ? comparator(previousValue, value) : previousValue === value : false;
|
|
4589
|
-
if (!areEqual) {
|
|
4590
|
-
hasValue = true;
|
|
4591
|
-
previousValue = value;
|
|
4592
|
-
subscriber.next(value);
|
|
4593
|
-
}
|
|
4594
|
-
},
|
|
4595
|
-
error: (err) => {
|
|
4596
|
-
subscriber.error(err);
|
|
4597
|
-
},
|
|
4598
|
-
complete: () => {
|
|
4599
|
-
subscriber.complete();
|
|
4600
|
-
}
|
|
4601
|
-
});
|
|
4602
|
-
return subscription;
|
|
4603
|
-
});
|
|
4604
|
-
};
|
|
4605
|
-
}
|
|
4606
|
-
|
|
4607
|
-
// ../core/dist/esm/message/operators/filter.js
|
|
4608
|
-
function filter(predicate) {
|
|
4609
|
-
return (source) => {
|
|
4610
|
-
return new Observable((subscriber) => {
|
|
4611
|
-
let index = 0;
|
|
4612
|
-
const subscription = source.subscribe({
|
|
4613
|
-
next: (value) => {
|
|
4614
|
-
try {
|
|
4615
|
-
if (predicate(value, index++)) {
|
|
4616
|
-
subscriber.next(value);
|
|
4617
|
-
}
|
|
4618
|
-
} catch (err) {
|
|
4619
|
-
subscriber.error(err);
|
|
4620
|
-
}
|
|
4621
|
-
},
|
|
4622
|
-
error: (err) => {
|
|
4623
|
-
subscriber.error(err);
|
|
4624
|
-
},
|
|
4625
|
-
complete: () => {
|
|
4626
|
-
subscriber.complete();
|
|
4627
|
-
}
|
|
4628
|
-
});
|
|
4629
|
-
return subscription;
|
|
4630
|
-
});
|
|
4631
|
-
};
|
|
4632
|
-
}
|
|
4633
|
-
|
|
4634
|
-
// ../core/dist/esm/message/operators/from.js
|
|
4635
|
-
function from(input) {
|
|
4636
|
-
return new Observable((subscriber) => {
|
|
4637
|
-
for (let i = 0; i < input.length; i++) {
|
|
4638
|
-
subscriber.next(input[i]);
|
|
4639
|
-
}
|
|
4640
|
-
subscriber.complete();
|
|
4641
|
-
});
|
|
4642
|
-
}
|
|
4643
|
-
|
|
4644
|
-
// ../core/dist/esm/message/operators/map.js
|
|
4645
|
-
function map(project) {
|
|
4646
|
-
return (source) => {
|
|
4647
|
-
return new Observable((subscriber) => {
|
|
4648
|
-
let index = 0;
|
|
4649
|
-
const subscription = source.subscribe({
|
|
4650
|
-
next: (value) => {
|
|
4651
|
-
try {
|
|
4652
|
-
subscriber.next(project(value, index++));
|
|
4653
|
-
} catch (err) {
|
|
4654
|
-
subscriber.error(err);
|
|
4655
|
-
}
|
|
4656
|
-
},
|
|
4657
|
-
error: (err) => {
|
|
4658
|
-
subscriber.error(err);
|
|
4659
|
-
},
|
|
4660
|
-
complete: () => {
|
|
4661
|
-
subscriber.complete();
|
|
4662
|
-
}
|
|
4663
|
-
});
|
|
4664
|
-
return subscription;
|
|
4665
|
-
});
|
|
4666
|
-
};
|
|
4667
|
-
}
|
|
4668
|
-
|
|
4669
|
-
// ../core/dist/esm/message/operators/skip.js
|
|
4670
|
-
function skip2(count) {
|
|
4671
|
-
return (source) => {
|
|
4672
|
-
return new Observable((subscriber) => {
|
|
4673
|
-
let skipped = 0;
|
|
4674
|
-
const sourceSubscription = source.subscribe({
|
|
4675
|
-
next: (value) => {
|
|
4676
|
-
if (skipped < count) {
|
|
4677
|
-
skipped++;
|
|
4678
|
-
} else {
|
|
4679
|
-
subscriber.next(value);
|
|
4680
|
-
}
|
|
4681
|
-
},
|
|
4682
|
-
error: (err) => {
|
|
4683
|
-
subscriber.error(err);
|
|
4684
|
-
},
|
|
4685
|
-
complete: () => {
|
|
4686
|
-
subscriber.complete();
|
|
4687
|
-
}
|
|
4688
|
-
});
|
|
4689
|
-
return () => {
|
|
4690
|
-
sourceSubscription.unsubscribe();
|
|
4691
|
-
};
|
|
4692
|
-
});
|
|
4693
|
-
};
|
|
4694
|
-
}
|
|
4695
|
-
|
|
4696
|
-
// ../core/dist/esm/message/operators/tap.js
|
|
4697
|
-
function tap(observerOrNext, error, complete) {
|
|
4698
|
-
return (source) => {
|
|
4699
|
-
return new Observable((subscriber) => {
|
|
4700
|
-
const partialObserver = {
|
|
4701
|
-
next: typeof observerOrNext === "object" ? observerOrNext.next : observerOrNext,
|
|
4702
|
-
error: typeof observerOrNext === "object" ? observerOrNext.error : error,
|
|
4703
|
-
complete: typeof observerOrNext === "object" ? observerOrNext.complete : complete
|
|
4704
|
-
};
|
|
4705
|
-
const subscription = source.subscribe({
|
|
4706
|
-
next: (value) => {
|
|
4707
|
-
try {
|
|
4708
|
-
partialObserver.next?.(value);
|
|
4709
|
-
} catch (err) {
|
|
4710
|
-
subscriber.error(err);
|
|
4711
|
-
return;
|
|
4712
|
-
}
|
|
4713
|
-
subscriber.next(value);
|
|
4714
|
-
},
|
|
4715
|
-
error: (err) => {
|
|
4716
|
-
try {
|
|
4717
|
-
partialObserver.error?.(err);
|
|
4718
|
-
} catch (e) {
|
|
4719
|
-
subscriber.error(e);
|
|
4720
|
-
return;
|
|
4721
|
-
}
|
|
4722
|
-
subscriber.error(err);
|
|
4723
|
-
},
|
|
4724
|
-
complete: () => {
|
|
4725
|
-
try {
|
|
4726
|
-
partialObserver.complete?.();
|
|
4727
|
-
} catch (err) {
|
|
4728
|
-
subscriber.error(err);
|
|
4729
|
-
return;
|
|
4730
|
-
}
|
|
4731
|
-
subscriber.complete();
|
|
4732
|
-
}
|
|
4733
|
-
});
|
|
4734
|
-
return subscription;
|
|
4735
|
-
});
|
|
4736
|
-
};
|
|
4737
|
-
}
|
|
4738
|
-
|
|
4739
|
-
// ../core/dist/esm/message/operators/switchMap.js
|
|
4740
|
-
function switchMap(project) {
|
|
4741
|
-
return (source) => {
|
|
4742
|
-
return new Observable((subscriber) => {
|
|
4743
|
-
let index = 0;
|
|
4744
|
-
let innerSubscription = null;
|
|
4745
|
-
let hasCompleted = false;
|
|
4746
|
-
let outerCompleted = false;
|
|
4747
|
-
const checkForComplete = () => {
|
|
4748
|
-
if (outerCompleted && !innerSubscription) {
|
|
4749
|
-
subscriber.complete();
|
|
4750
|
-
}
|
|
4751
|
-
};
|
|
4752
|
-
const outerSubscription = source.subscribe({
|
|
4753
|
-
next: (value) => {
|
|
4754
|
-
if (innerSubscription) {
|
|
4755
|
-
innerSubscription.unsubscribe();
|
|
4756
|
-
innerSubscription = null;
|
|
4757
|
-
}
|
|
4758
|
-
try {
|
|
4759
|
-
const innerObservable = project(value, index++);
|
|
4760
|
-
let isInnerComplete = false;
|
|
4761
|
-
let currentInnerSub = null;
|
|
4762
|
-
const sub = innerObservable.subscribe({
|
|
4763
|
-
next: (innerValue) => {
|
|
4764
|
-
subscriber.next(innerValue);
|
|
4765
|
-
},
|
|
4766
|
-
error: (err) => {
|
|
4767
|
-
subscriber.error(err);
|
|
4768
|
-
},
|
|
4769
|
-
complete: () => {
|
|
4770
|
-
isInnerComplete = true;
|
|
4771
|
-
if (innerSubscription === currentInnerSub) {
|
|
4772
|
-
innerSubscription = null;
|
|
4773
|
-
}
|
|
4774
|
-
checkForComplete();
|
|
4775
|
-
}
|
|
4776
|
-
});
|
|
4777
|
-
if (!isInnerComplete) {
|
|
4778
|
-
currentInnerSub = sub;
|
|
4779
|
-
innerSubscription = sub;
|
|
4780
|
-
}
|
|
4781
|
-
} catch (err) {
|
|
4782
|
-
subscriber.error(err);
|
|
4783
|
-
}
|
|
4784
|
-
},
|
|
4785
|
-
error: (err) => {
|
|
4786
|
-
subscriber.error(err);
|
|
4787
|
-
},
|
|
4788
|
-
complete: () => {
|
|
4789
|
-
outerCompleted = true;
|
|
4790
|
-
checkForComplete();
|
|
4791
|
-
}
|
|
4792
|
-
});
|
|
4793
|
-
return () => {
|
|
4794
|
-
outerSubscription.unsubscribe();
|
|
4795
|
-
if (innerSubscription) {
|
|
4796
|
-
innerSubscription.unsubscribe();
|
|
4797
|
-
}
|
|
4798
|
-
};
|
|
4799
|
-
});
|
|
4800
|
-
};
|
|
4801
|
-
}
|
|
4802
|
-
|
|
4803
|
-
// ../core/dist/esm/message/operators/mergeMap.js
|
|
4804
|
-
function mergeMap(project) {
|
|
4805
|
-
return (source) => {
|
|
4806
|
-
return new Observable((subscriber) => {
|
|
4807
|
-
let index = 0;
|
|
4808
|
-
let activeCount = 0;
|
|
4809
|
-
let hasCompleted = false;
|
|
4810
|
-
const innerSubscriptions = [];
|
|
4811
|
-
const checkComplete = () => {
|
|
4812
|
-
if (hasCompleted && activeCount === 0) {
|
|
4813
|
-
subscriber.complete();
|
|
4814
|
-
}
|
|
4815
|
-
};
|
|
4816
|
-
const sourceSubscription = source.subscribe({
|
|
4817
|
-
next: (value) => {
|
|
4818
|
-
activeCount++;
|
|
4819
|
-
const currentIndex = index++;
|
|
4820
|
-
try {
|
|
4821
|
-
const projected = project(value, currentIndex);
|
|
4822
|
-
const innerObservable = projected instanceof Promise ? new Observable((innerSubscriber) => {
|
|
4823
|
-
projected.then((result) => {
|
|
4824
|
-
innerSubscriber.next(result);
|
|
4825
|
-
innerSubscriber.complete();
|
|
4826
|
-
}).catch((err) => {
|
|
4827
|
-
innerSubscriber.error(err);
|
|
4828
|
-
});
|
|
4829
|
-
}) : projected;
|
|
4830
|
-
let isInnerComplete = false;
|
|
4831
|
-
let innerSubscription = null;
|
|
4832
|
-
const sub = innerObservable.subscribe({
|
|
4833
|
-
next: (innerValue) => {
|
|
4834
|
-
subscriber.next(innerValue);
|
|
4835
|
-
},
|
|
4836
|
-
error: (err) => {
|
|
4837
|
-
activeCount--;
|
|
4838
|
-
subscriber.error(err);
|
|
4839
|
-
},
|
|
4840
|
-
complete: () => {
|
|
4841
|
-
activeCount--;
|
|
4842
|
-
isInnerComplete = true;
|
|
4843
|
-
if (innerSubscription) {
|
|
4844
|
-
const idx = innerSubscriptions.indexOf(innerSubscription);
|
|
4845
|
-
if (idx >= 0) {
|
|
4846
|
-
innerSubscriptions.splice(idx, 1);
|
|
4847
|
-
}
|
|
4848
|
-
}
|
|
4849
|
-
checkComplete();
|
|
4850
|
-
}
|
|
4851
|
-
});
|
|
4852
|
-
if (!isInnerComplete) {
|
|
4853
|
-
innerSubscription = sub;
|
|
4854
|
-
innerSubscriptions.push(innerSubscription);
|
|
4855
|
-
}
|
|
4856
|
-
} catch (err) {
|
|
4857
|
-
activeCount--;
|
|
4858
|
-
subscriber.error(err);
|
|
4859
|
-
}
|
|
4860
|
-
},
|
|
4861
|
-
error: (err) => {
|
|
4862
|
-
subscriber.error(err);
|
|
4863
|
-
},
|
|
4864
|
-
complete: () => {
|
|
4865
|
-
hasCompleted = true;
|
|
4866
|
-
checkComplete();
|
|
4867
|
-
}
|
|
4868
|
-
});
|
|
4869
|
-
return () => {
|
|
4870
|
-
sourceSubscription.unsubscribe();
|
|
4871
|
-
innerSubscriptions.forEach((sub) => sub.unsubscribe());
|
|
4872
|
-
};
|
|
4873
|
-
});
|
|
4874
|
-
};
|
|
4875
|
-
}
|
|
4876
|
-
|
|
4877
|
-
// ../core/dist/esm/message/operators/concatMap.js
|
|
4878
|
-
function concatMap(project) {
|
|
4879
|
-
return (source) => {
|
|
4880
|
-
return new Observable((subscriber) => {
|
|
4881
|
-
let index = 0;
|
|
4882
|
-
let buffer = [];
|
|
4883
|
-
let activeInnerSubscription = null;
|
|
4884
|
-
let hasCompleted = false;
|
|
4885
|
-
const checkForComplete = () => {
|
|
4886
|
-
if (hasCompleted && !activeInnerSubscription && buffer.length === 0) {
|
|
4887
|
-
subscriber.complete();
|
|
4888
|
-
}
|
|
4889
|
-
};
|
|
4890
|
-
const subscribeToNext = () => {
|
|
4891
|
-
if (buffer.length === 0 || activeInnerSubscription) {
|
|
4892
|
-
return;
|
|
4893
|
-
}
|
|
4894
|
-
const next = buffer.shift();
|
|
4895
|
-
try {
|
|
4896
|
-
const innerObservable = project(next.value, next.index);
|
|
4897
|
-
let isInnerComplete = false;
|
|
4898
|
-
const sub = innerObservable.subscribe({
|
|
4899
|
-
next: (innerValue) => {
|
|
4900
|
-
subscriber.next(innerValue);
|
|
4901
|
-
},
|
|
4902
|
-
error: (err) => {
|
|
4903
|
-
activeInnerSubscription = null;
|
|
4904
|
-
subscriber.error(err);
|
|
4905
|
-
},
|
|
4906
|
-
complete: () => {
|
|
4907
|
-
isInnerComplete = true;
|
|
4908
|
-
activeInnerSubscription = null;
|
|
4909
|
-
subscribeToNext();
|
|
4910
|
-
checkForComplete();
|
|
4911
|
-
}
|
|
4912
|
-
});
|
|
4913
|
-
if (!isInnerComplete) {
|
|
4914
|
-
activeInnerSubscription = sub;
|
|
4915
|
-
}
|
|
4916
|
-
} catch (err) {
|
|
4917
|
-
activeInnerSubscription = null;
|
|
4918
|
-
subscriber.error(err);
|
|
4919
|
-
}
|
|
4920
|
-
};
|
|
4921
|
-
const outerSubscription = source.subscribe({
|
|
4922
|
-
next: (value) => {
|
|
4923
|
-
buffer.push({ value, index: index++ });
|
|
4924
|
-
subscribeToNext();
|
|
4925
|
-
},
|
|
4926
|
-
error: (err) => {
|
|
4927
|
-
subscriber.error(err);
|
|
4928
|
-
},
|
|
4929
|
-
complete: () => {
|
|
4930
|
-
hasCompleted = true;
|
|
4931
|
-
checkForComplete();
|
|
4932
|
-
}
|
|
4933
|
-
});
|
|
4934
|
-
return () => {
|
|
4935
|
-
outerSubscription.unsubscribe();
|
|
4936
|
-
if (activeInnerSubscription) {
|
|
4937
|
-
activeInnerSubscription.unsubscribe();
|
|
4938
|
-
}
|
|
4939
|
-
};
|
|
4940
|
-
});
|
|
4941
|
-
};
|
|
4942
|
-
}
|
|
4943
|
-
|
|
4944
|
-
// ../core/dist/esm/message/operators/catchError.js
|
|
4945
|
-
function catchError(selector) {
|
|
4946
|
-
return (source) => {
|
|
4947
|
-
return new Observable((subscriber) => {
|
|
4948
|
-
let subscription;
|
|
4949
|
-
const subscribeToSource = () => {
|
|
4950
|
-
subscription = source.subscribe({
|
|
4951
|
-
next: (value) => {
|
|
4952
|
-
subscriber.next(value);
|
|
4953
|
-
},
|
|
4954
|
-
error: (err) => {
|
|
4955
|
-
try {
|
|
4956
|
-
const result = selector(err, source);
|
|
4957
|
-
let isInnerComplete = false;
|
|
4958
|
-
const sub = result.subscribe({
|
|
4959
|
-
next: (value) => {
|
|
4960
|
-
subscriber.next(value);
|
|
4961
|
-
},
|
|
4962
|
-
error: (innerErr) => {
|
|
4963
|
-
subscriber.error(innerErr);
|
|
4964
|
-
},
|
|
4965
|
-
complete: () => {
|
|
4966
|
-
isInnerComplete = true;
|
|
4967
|
-
subscriber.complete();
|
|
4968
|
-
}
|
|
4969
|
-
});
|
|
4970
|
-
if (!isInnerComplete) {
|
|
4971
|
-
subscription = sub;
|
|
4972
|
-
}
|
|
4973
|
-
} catch (selectorErr) {
|
|
4974
|
-
subscriber.error(selectorErr);
|
|
4975
|
-
}
|
|
4976
|
-
},
|
|
4977
|
-
complete: () => {
|
|
4978
|
-
subscriber.complete();
|
|
4979
|
-
}
|
|
4980
|
-
});
|
|
4981
|
-
};
|
|
4982
|
-
subscribeToSource();
|
|
4983
|
-
return () => {
|
|
4984
|
-
if (subscription) {
|
|
4985
|
-
subscription.unsubscribe();
|
|
4986
|
-
}
|
|
4987
|
-
};
|
|
4988
|
-
});
|
|
4989
|
-
};
|
|
4990
|
-
}
|
|
4991
|
-
|
|
4992
|
-
// ../core/dist/esm/message/operators/retry.js
|
|
4993
|
-
function retry(count = 3) {
|
|
4994
|
-
return (source) => {
|
|
4995
|
-
return new Observable((subscriber) => {
|
|
4996
|
-
let retryCount = 0;
|
|
4997
|
-
let subscription;
|
|
4998
|
-
const subscribeToSource = () => {
|
|
4999
|
-
subscription = source.subscribe({
|
|
5000
|
-
next: (value) => {
|
|
5001
|
-
subscriber.next(value);
|
|
5002
|
-
},
|
|
5003
|
-
error: (err) => {
|
|
5004
|
-
if (retryCount < count) {
|
|
5005
|
-
retryCount++;
|
|
5006
|
-
subscribeToSource();
|
|
5007
|
-
} else {
|
|
5008
|
-
subscriber.error(err);
|
|
5009
|
-
}
|
|
5010
|
-
},
|
|
5011
|
-
complete: () => {
|
|
5012
|
-
subscriber.complete();
|
|
5013
|
-
}
|
|
5014
|
-
});
|
|
5015
|
-
};
|
|
5016
|
-
subscribeToSource();
|
|
5017
|
-
return () => {
|
|
5018
|
-
if (subscription) {
|
|
5019
|
-
subscription.unsubscribe();
|
|
5020
|
-
}
|
|
5021
|
-
};
|
|
5022
|
-
});
|
|
5023
|
-
};
|
|
5024
|
-
}
|
|
5025
|
-
|
|
5026
|
-
// ../core/dist/esm/message/operators/delay.js
|
|
5027
|
-
function delay(delayMs, config) {
|
|
5028
|
-
return (source) => {
|
|
5029
|
-
return new Observable((subscriber) => {
|
|
5030
|
-
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
5031
|
-
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
5032
|
-
const timeouts = [];
|
|
5033
|
-
const subscription = source.subscribe({
|
|
5034
|
-
next: (value) => {
|
|
5035
|
-
const timeoutId = setTimeoutFn(() => {
|
|
5036
|
-
subscriber.next(value);
|
|
5037
|
-
}, delayMs);
|
|
5038
|
-
timeouts.push(timeoutId);
|
|
5039
|
-
},
|
|
5040
|
-
error: (err) => {
|
|
5041
|
-
const timeoutId = setTimeoutFn(() => {
|
|
5042
|
-
subscriber.error(err);
|
|
5043
|
-
}, delayMs);
|
|
5044
|
-
timeouts.push(timeoutId);
|
|
5045
|
-
},
|
|
5046
|
-
complete: () => {
|
|
5047
|
-
const timeoutId = setTimeoutFn(() => {
|
|
5048
|
-
subscriber.complete();
|
|
5049
|
-
}, delayMs);
|
|
5050
|
-
timeouts.push(timeoutId);
|
|
5051
|
-
}
|
|
5052
|
-
});
|
|
5053
|
-
return () => {
|
|
5054
|
-
subscription.unsubscribe();
|
|
5055
|
-
timeouts.forEach((timeout2) => clearTimeoutFn(timeout2));
|
|
5056
|
-
};
|
|
5057
|
-
});
|
|
5058
|
-
};
|
|
5059
|
-
}
|
|
5060
|
-
|
|
5061
|
-
// ../core/dist/esm/message/operators/timeout.js
|
|
5062
|
-
var TimeoutError = class extends Error {
|
|
5063
|
-
constructor(message = "Timeout has occurred") {
|
|
5064
|
-
super(message);
|
|
5065
|
-
this.name = "TimeoutError";
|
|
5066
|
-
}
|
|
5067
|
-
};
|
|
5068
|
-
function timeout(due, config) {
|
|
5069
|
-
return (source) => {
|
|
5070
|
-
return new Observable((subscriber) => {
|
|
5071
|
-
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
5072
|
-
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
5073
|
-
let timeoutId;
|
|
5074
|
-
let hasEmitted = false;
|
|
5075
|
-
const resetTimeout = () => {
|
|
5076
|
-
if (timeoutId) {
|
|
5077
|
-
clearTimeoutFn(timeoutId);
|
|
5078
|
-
}
|
|
5079
|
-
timeoutId = setTimeoutFn(() => {
|
|
5080
|
-
if (!hasEmitted) {
|
|
5081
|
-
subscriber.error(new TimeoutError());
|
|
5082
|
-
}
|
|
5083
|
-
}, due);
|
|
5084
|
-
};
|
|
5085
|
-
resetTimeout();
|
|
5086
|
-
const subscription = source.subscribe({
|
|
5087
|
-
next: (value) => {
|
|
5088
|
-
hasEmitted = true;
|
|
5089
|
-
clearTimeoutFn(timeoutId);
|
|
5090
|
-
subscriber.next(value);
|
|
5091
|
-
resetTimeout();
|
|
5092
|
-
},
|
|
5093
|
-
error: (err) => {
|
|
5094
|
-
clearTimeoutFn(timeoutId);
|
|
5095
|
-
subscriber.error(err);
|
|
5096
|
-
},
|
|
5097
|
-
complete: () => {
|
|
5098
|
-
clearTimeoutFn(timeoutId);
|
|
5099
|
-
subscriber.complete();
|
|
5100
|
-
}
|
|
5101
|
-
});
|
|
5102
|
-
return () => {
|
|
5103
|
-
clearTimeoutFn(timeoutId);
|
|
5104
|
-
subscription.unsubscribe();
|
|
5105
|
-
};
|
|
5106
|
-
});
|
|
5107
|
-
};
|
|
5108
|
-
}
|
|
5109
|
-
|
|
5110
|
-
// ../core/dist/esm/message/operators/scan.js
|
|
5111
|
-
function scan(accumulator, seed) {
|
|
5112
|
-
return (source) => {
|
|
5113
|
-
return new Observable((subscriber) => {
|
|
5114
|
-
let hasAccumulator = arguments.length >= 2;
|
|
5115
|
-
let acc = seed;
|
|
5116
|
-
let index = 0;
|
|
5117
|
-
const subscription = source.subscribe({
|
|
5118
|
-
next: (value) => {
|
|
5119
|
-
try {
|
|
5120
|
-
if (!hasAccumulator) {
|
|
5121
|
-
acc = value;
|
|
5122
|
-
hasAccumulator = true;
|
|
5123
|
-
} else {
|
|
5124
|
-
acc = accumulator(acc, value, index);
|
|
5125
|
-
}
|
|
5126
|
-
subscriber.next(acc);
|
|
5127
|
-
index++;
|
|
5128
|
-
} catch (err) {
|
|
5129
|
-
subscriber.error(err);
|
|
5130
|
-
}
|
|
5131
|
-
},
|
|
5132
|
-
error: (err) => {
|
|
5133
|
-
subscriber.error(err);
|
|
5134
|
-
},
|
|
5135
|
-
complete: () => {
|
|
5136
|
-
subscriber.complete();
|
|
5137
|
-
}
|
|
5138
|
-
});
|
|
5139
|
-
return subscription;
|
|
5140
|
-
});
|
|
5141
|
-
};
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
// ../core/dist/esm/message/operators/reduce.js
|
|
5145
|
-
function reduce(accumulator, seed) {
|
|
5146
|
-
return (source) => {
|
|
5147
|
-
return new Observable((subscriber) => {
|
|
5148
|
-
let hasAccumulator = arguments.length >= 2;
|
|
5149
|
-
let acc = seed;
|
|
5150
|
-
let index = 0;
|
|
5151
|
-
const subscription = source.subscribe({
|
|
5152
|
-
next: (value) => {
|
|
5153
|
-
try {
|
|
5154
|
-
if (!hasAccumulator) {
|
|
5155
|
-
acc = value;
|
|
5156
|
-
hasAccumulator = true;
|
|
5157
|
-
} else {
|
|
5158
|
-
acc = accumulator(acc, value, index);
|
|
5159
|
-
}
|
|
5160
|
-
index++;
|
|
5161
|
-
} catch (err) {
|
|
5162
|
-
subscriber.error(err);
|
|
5163
|
-
}
|
|
5164
|
-
},
|
|
5165
|
-
error: (err) => {
|
|
5166
|
-
subscriber.error(err);
|
|
5167
|
-
},
|
|
5168
|
-
complete: () => {
|
|
5169
|
-
if (hasAccumulator) {
|
|
5170
|
-
subscriber.next(acc);
|
|
5171
|
-
subscriber.complete();
|
|
5172
|
-
} else {
|
|
5173
|
-
subscriber.error(new Error("Reduce of empty sequence with no initial value"));
|
|
5174
|
-
}
|
|
5175
|
-
}
|
|
5176
|
-
});
|
|
5177
|
-
return subscription;
|
|
5178
|
-
});
|
|
5179
|
-
};
|
|
5180
|
-
}
|
|
5181
|
-
|
|
5182
|
-
// ../core/dist/esm/message/operators/share.js
|
|
5183
|
-
function share() {
|
|
5184
|
-
return (source) => {
|
|
5185
|
-
let subject = null;
|
|
5186
|
-
let sourceSubscription = null;
|
|
5187
|
-
let refCount = 0;
|
|
5188
|
-
let hasCompleted = false;
|
|
5189
|
-
let hasErrored = false;
|
|
5190
|
-
const reset = () => {
|
|
5191
|
-
subject = null;
|
|
5192
|
-
sourceSubscription = null;
|
|
5193
|
-
hasCompleted = false;
|
|
5194
|
-
hasErrored = false;
|
|
5195
|
-
};
|
|
5196
|
-
return new Observable((subscriber) => {
|
|
5197
|
-
refCount++;
|
|
5198
|
-
let isFirst = false;
|
|
5199
|
-
if (!subject || hasCompleted || hasErrored) {
|
|
5200
|
-
if (sourceSubscription) {
|
|
5201
|
-
sourceSubscription.unsubscribe();
|
|
5202
|
-
}
|
|
5203
|
-
subject = new Subject();
|
|
5204
|
-
hasCompleted = false;
|
|
5205
|
-
hasErrored = false;
|
|
5206
|
-
isFirst = true;
|
|
5207
|
-
}
|
|
5208
|
-
const subscription = subject.subscribe({
|
|
5209
|
-
next: (value) => subscriber.next(value),
|
|
5210
|
-
error: (err) => subscriber.error(err),
|
|
5211
|
-
complete: () => subscriber.complete()
|
|
5212
|
-
});
|
|
5213
|
-
if (isFirst) {
|
|
5214
|
-
const sub = source.subscribe({
|
|
5215
|
-
next: (value) => {
|
|
5216
|
-
if (subject) {
|
|
5217
|
-
subject.next(value);
|
|
5218
|
-
}
|
|
5219
|
-
},
|
|
5220
|
-
error: (err) => {
|
|
5221
|
-
hasErrored = true;
|
|
5222
|
-
const s = subject;
|
|
5223
|
-
if (s) {
|
|
5224
|
-
s.error(err);
|
|
5225
|
-
}
|
|
5226
|
-
if (refCount === 0) {
|
|
5227
|
-
reset();
|
|
5228
|
-
}
|
|
5229
|
-
},
|
|
5230
|
-
complete: () => {
|
|
5231
|
-
hasCompleted = true;
|
|
5232
|
-
const s = subject;
|
|
5233
|
-
if (s) {
|
|
5234
|
-
s.complete();
|
|
5235
|
-
}
|
|
5236
|
-
if (refCount === 0) {
|
|
5237
|
-
reset();
|
|
5238
|
-
}
|
|
5239
|
-
}
|
|
5240
|
-
});
|
|
5241
|
-
if (!subject) {
|
|
5242
|
-
sub.unsubscribe();
|
|
5243
|
-
} else {
|
|
5244
|
-
sourceSubscription = sub;
|
|
5245
|
-
}
|
|
5246
|
-
}
|
|
5247
|
-
return () => {
|
|
5248
|
-
refCount--;
|
|
5249
|
-
subscription.unsubscribe();
|
|
5250
|
-
if (refCount === 0) {
|
|
5251
|
-
if (sourceSubscription) {
|
|
5252
|
-
sourceSubscription.unsubscribe();
|
|
5253
|
-
}
|
|
5254
|
-
reset();
|
|
5255
|
-
}
|
|
5256
|
-
};
|
|
5257
|
-
});
|
|
5258
|
-
};
|
|
5259
|
-
}
|
|
5260
|
-
|
|
5261
|
-
// ../core/dist/esm/message/operators/finalize.js
|
|
5262
|
-
function finalize(callback) {
|
|
5263
|
-
return (source) => {
|
|
5264
|
-
return new Observable((subscriber) => {
|
|
5265
|
-
let executed = false;
|
|
5266
|
-
const executeCallback = () => {
|
|
5267
|
-
if (!executed) {
|
|
5268
|
-
executed = true;
|
|
5269
|
-
callback();
|
|
5270
|
-
}
|
|
5271
|
-
};
|
|
5272
|
-
const subscription = source.subscribe({
|
|
5273
|
-
next: (value) => {
|
|
5274
|
-
subscriber.next(value);
|
|
5275
|
-
},
|
|
5276
|
-
error: (err) => {
|
|
5277
|
-
try {
|
|
5278
|
-
executeCallback();
|
|
5279
|
-
} finally {
|
|
5280
|
-
subscriber.error(err);
|
|
5281
|
-
}
|
|
5282
|
-
},
|
|
5283
|
-
complete: () => {
|
|
5284
|
-
try {
|
|
5285
|
-
executeCallback();
|
|
5286
|
-
} finally {
|
|
5287
|
-
subscriber.complete();
|
|
5288
|
-
}
|
|
5289
|
-
}
|
|
5290
|
-
});
|
|
5291
|
-
return () => {
|
|
5292
|
-
try {
|
|
5293
|
-
subscription.unsubscribe();
|
|
5294
|
-
} finally {
|
|
5295
|
-
executeCallback();
|
|
5296
|
-
}
|
|
5297
|
-
};
|
|
5298
|
-
});
|
|
5299
|
-
};
|
|
5300
|
-
}
|
|
5301
|
-
|
|
5302
|
-
// ../core/dist/esm/message/operators/first.js
|
|
5303
|
-
function first(predicate, defaultValue) {
|
|
5304
|
-
return (source) => {
|
|
5305
|
-
return new Observable((subscriber) => {
|
|
5306
|
-
let index = 0;
|
|
5307
|
-
let hasValue = false;
|
|
5308
|
-
const subscription = source.subscribe({
|
|
5309
|
-
next: (value) => {
|
|
5310
|
-
if (hasValue) {
|
|
5311
|
-
return;
|
|
5312
|
-
}
|
|
5313
|
-
const shouldEmit = predicate ? predicate(value, index++) : true;
|
|
5314
|
-
if (shouldEmit) {
|
|
5315
|
-
hasValue = true;
|
|
5316
|
-
subscriber.next(value);
|
|
5317
|
-
subscriber.complete();
|
|
5318
|
-
subscription.unsubscribe();
|
|
5319
|
-
}
|
|
5320
|
-
},
|
|
5321
|
-
error: (err) => {
|
|
5322
|
-
if (!hasValue) {
|
|
5323
|
-
subscriber.error(err);
|
|
5324
|
-
}
|
|
5325
|
-
},
|
|
5326
|
-
complete: () => {
|
|
5327
|
-
if (!hasValue) {
|
|
5328
|
-
if (defaultValue !== void 0) {
|
|
5329
|
-
subscriber.next(defaultValue);
|
|
5330
|
-
subscriber.complete();
|
|
5331
|
-
} else {
|
|
5332
|
-
subscriber.error(new Error("no elements in sequence"));
|
|
5333
|
-
}
|
|
5334
|
-
}
|
|
5335
|
-
}
|
|
5336
|
-
});
|
|
5337
|
-
return subscription;
|
|
5338
|
-
});
|
|
5339
|
-
};
|
|
5340
|
-
}
|
|
5341
|
-
|
|
5342
|
-
// ../core/dist/esm/message/operators/take.js
|
|
5343
|
-
function take2(count) {
|
|
5344
|
-
return (source) => {
|
|
5345
|
-
return new Observable((subscriber) => {
|
|
5346
|
-
let taken = 0;
|
|
5347
|
-
if (count === 0) {
|
|
5348
|
-
subscriber.complete();
|
|
5349
|
-
return;
|
|
5350
|
-
}
|
|
5351
|
-
const sourceSubscription = source.subscribe({
|
|
5352
|
-
next: (value) => {
|
|
5353
|
-
if (taken < count) {
|
|
5354
|
-
taken++;
|
|
5355
|
-
subscriber.next(value);
|
|
5356
|
-
if (taken === count) {
|
|
5357
|
-
subscriber.complete();
|
|
5358
|
-
sourceSubscription.unsubscribe();
|
|
5359
|
-
}
|
|
5360
|
-
}
|
|
5361
|
-
},
|
|
5362
|
-
error: (err) => {
|
|
5363
|
-
subscriber.error(err);
|
|
5364
|
-
},
|
|
5365
|
-
complete: () => {
|
|
5366
|
-
subscriber.complete();
|
|
5367
|
-
}
|
|
5368
|
-
});
|
|
5369
|
-
return () => {
|
|
5370
|
-
sourceSubscription.unsubscribe();
|
|
5371
|
-
};
|
|
5372
|
-
});
|
|
5373
|
-
};
|
|
4395
|
+
complete: () => subscriber.complete()
|
|
4396
|
+
});
|
|
4397
|
+
}
|
|
4398
|
+
});
|
|
5374
4399
|
}
|
|
5375
4400
|
|
|
5376
|
-
// ../core/dist/esm/message/
|
|
5377
|
-
function
|
|
4401
|
+
// ../core/dist/esm/message/internal/skip.js
|
|
4402
|
+
function skip(count) {
|
|
5378
4403
|
return (source) => {
|
|
5379
4404
|
return new Observable((subscriber) => {
|
|
5380
|
-
let
|
|
5381
|
-
const
|
|
4405
|
+
let skipped = 0;
|
|
4406
|
+
const subscription = source.subscribe({
|
|
5382
4407
|
next: (value) => {
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
sourceSubscription.unsubscribe();
|
|
5388
|
-
}
|
|
5389
|
-
} catch (err) {
|
|
5390
|
-
subscriber.error(err);
|
|
4408
|
+
if (skipped < count) {
|
|
4409
|
+
skipped++;
|
|
4410
|
+
} else {
|
|
4411
|
+
subscriber.next(value);
|
|
5391
4412
|
}
|
|
5392
4413
|
},
|
|
5393
4414
|
error: (err) => {
|
|
@@ -5397,29 +4418,26 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5397
4418
|
subscriber.complete();
|
|
5398
4419
|
}
|
|
5399
4420
|
});
|
|
5400
|
-
return
|
|
5401
|
-
sourceSubscription.unsubscribe();
|
|
5402
|
-
};
|
|
4421
|
+
return subscription;
|
|
5403
4422
|
});
|
|
5404
4423
|
};
|
|
5405
4424
|
}
|
|
5406
4425
|
|
|
5407
|
-
// ../core/dist/esm/message/
|
|
5408
|
-
function
|
|
4426
|
+
// ../core/dist/esm/message/internal/takeWhile.js
|
|
4427
|
+
function takeWhile(predicate, inclusive = false) {
|
|
5409
4428
|
return (source) => {
|
|
5410
4429
|
return new Observable((subscriber) => {
|
|
5411
4430
|
let index = 0;
|
|
5412
|
-
const
|
|
4431
|
+
const subscription = source.subscribe({
|
|
5413
4432
|
next: (value) => {
|
|
5414
|
-
|
|
5415
|
-
|
|
4433
|
+
const result = predicate(value, index++);
|
|
4434
|
+
if (result) {
|
|
4435
|
+
subscriber.next(value);
|
|
4436
|
+
} else {
|
|
4437
|
+
if (inclusive) {
|
|
5416
4438
|
subscriber.next(value);
|
|
5417
|
-
} else {
|
|
5418
|
-
subscriber.complete();
|
|
5419
|
-
sourceSubscription.unsubscribe();
|
|
5420
4439
|
}
|
|
5421
|
-
|
|
5422
|
-
subscriber.error(err);
|
|
4440
|
+
subscriber.complete();
|
|
5423
4441
|
}
|
|
5424
4442
|
},
|
|
5425
4443
|
error: (err) => {
|
|
@@ -5429,72 +4447,19 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5429
4447
|
subscriber.complete();
|
|
5430
4448
|
}
|
|
5431
4449
|
});
|
|
5432
|
-
return
|
|
5433
|
-
sourceSubscription.unsubscribe();
|
|
5434
|
-
};
|
|
5435
|
-
});
|
|
5436
|
-
};
|
|
5437
|
-
}
|
|
5438
|
-
|
|
5439
|
-
// ../core/dist/esm/message/operators/single.js
|
|
5440
|
-
var EmptyError2 = class extends Error {
|
|
5441
|
-
constructor(message = "No elements in single") {
|
|
5442
|
-
super(message);
|
|
5443
|
-
this.name = "EmptyError";
|
|
5444
|
-
}
|
|
5445
|
-
};
|
|
5446
|
-
var SequenceError = class extends Error {
|
|
5447
|
-
constructor(message) {
|
|
5448
|
-
super(message);
|
|
5449
|
-
this.name = "SequenceError";
|
|
5450
|
-
}
|
|
5451
|
-
};
|
|
5452
|
-
function single(predicate) {
|
|
5453
|
-
return (source) => {
|
|
5454
|
-
return new Observable((subscriber) => {
|
|
5455
|
-
let index = 0;
|
|
5456
|
-
let match;
|
|
5457
|
-
let hasFound = false;
|
|
5458
|
-
const sourceSubscription = source.subscribe({
|
|
5459
|
-
next: (value) => {
|
|
5460
|
-
try {
|
|
5461
|
-
if (predicate(value, index++)) {
|
|
5462
|
-
if (hasFound) {
|
|
5463
|
-
subscriber.error(new SequenceError("Sequence contains more than one element"));
|
|
5464
|
-
sourceSubscription.unsubscribe();
|
|
5465
|
-
} else {
|
|
5466
|
-
match = value;
|
|
5467
|
-
hasFound = true;
|
|
5468
|
-
}
|
|
5469
|
-
}
|
|
5470
|
-
} catch (err) {
|
|
5471
|
-
subscriber.error(err);
|
|
5472
|
-
}
|
|
5473
|
-
},
|
|
5474
|
-
error: (err) => {
|
|
5475
|
-
subscriber.error(err);
|
|
5476
|
-
},
|
|
5477
|
-
complete: () => {
|
|
5478
|
-
if (hasFound) {
|
|
5479
|
-
subscriber.next(match);
|
|
5480
|
-
subscriber.complete();
|
|
5481
|
-
} else {
|
|
5482
|
-
subscriber.error(new EmptyError2());
|
|
5483
|
-
}
|
|
5484
|
-
}
|
|
5485
|
-
});
|
|
5486
|
-
return () => {
|
|
5487
|
-
sourceSubscription.unsubscribe();
|
|
5488
|
-
};
|
|
4450
|
+
return subscription;
|
|
5489
4451
|
});
|
|
5490
4452
|
};
|
|
5491
4453
|
}
|
|
5492
4454
|
|
|
5493
|
-
// ../core/dist/esm/message/
|
|
5494
|
-
function
|
|
4455
|
+
// ../core/dist/esm/message/internal/startWith.js
|
|
4456
|
+
function startWith(...values) {
|
|
5495
4457
|
return (source) => {
|
|
5496
4458
|
return new Observable((subscriber) => {
|
|
5497
|
-
const
|
|
4459
|
+
for (const value of values) {
|
|
4460
|
+
subscriber.next(value);
|
|
4461
|
+
}
|
|
4462
|
+
const subscription = source.subscribe({
|
|
5498
4463
|
next: (value) => {
|
|
5499
4464
|
subscriber.next(value);
|
|
5500
4465
|
},
|
|
@@ -5505,202 +4470,110 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5505
4470
|
subscriber.complete();
|
|
5506
4471
|
}
|
|
5507
4472
|
});
|
|
5508
|
-
|
|
5509
|
-
next: () => {
|
|
5510
|
-
subscriber.complete();
|
|
5511
|
-
sourceSubscription.unsubscribe();
|
|
5512
|
-
notifierSubscription.unsubscribe();
|
|
5513
|
-
},
|
|
5514
|
-
error: (err) => {
|
|
5515
|
-
subscriber.error(err);
|
|
5516
|
-
},
|
|
5517
|
-
complete: () => {
|
|
5518
|
-
}
|
|
5519
|
-
});
|
|
5520
|
-
return () => {
|
|
5521
|
-
sourceSubscription.unsubscribe();
|
|
5522
|
-
notifierSubscription.unsubscribe();
|
|
5523
|
-
};
|
|
4473
|
+
return subscription;
|
|
5524
4474
|
});
|
|
5525
4475
|
};
|
|
5526
4476
|
}
|
|
5527
4477
|
|
|
5528
|
-
// ../core/dist/esm/message/
|
|
5529
|
-
function
|
|
5530
|
-
return (
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
4478
|
+
// ../core/dist/esm/message/internal/concat.js
|
|
4479
|
+
function concat(...observables) {
|
|
4480
|
+
return new Observable((subscriber) => {
|
|
4481
|
+
let currentIndex = 0;
|
|
4482
|
+
let currentSubscription;
|
|
4483
|
+
function subscribeToNext() {
|
|
4484
|
+
if (currentIndex >= observables.length) {
|
|
5534
4485
|
subscriber.complete();
|
|
5535
4486
|
return;
|
|
5536
4487
|
}
|
|
5537
|
-
const
|
|
4488
|
+
const currentObservable = observables[currentIndex++];
|
|
4489
|
+
currentSubscription = currentObservable.subscribe({
|
|
5538
4490
|
next: (value) => {
|
|
5539
|
-
|
|
5540
|
-
if (buffer.length > count) {
|
|
5541
|
-
buffer.shift();
|
|
5542
|
-
}
|
|
4491
|
+
subscriber.next(value);
|
|
5543
4492
|
},
|
|
5544
4493
|
error: (err) => {
|
|
5545
4494
|
subscriber.error(err);
|
|
5546
4495
|
},
|
|
5547
4496
|
complete: () => {
|
|
5548
|
-
|
|
5549
|
-
subscriber.next(value);
|
|
5550
|
-
}
|
|
5551
|
-
subscriber.complete();
|
|
4497
|
+
subscribeToNext();
|
|
5552
4498
|
}
|
|
5553
4499
|
});
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
4500
|
+
}
|
|
4501
|
+
subscribeToNext();
|
|
4502
|
+
return () => {
|
|
4503
|
+
if (currentSubscription) {
|
|
4504
|
+
currentSubscription.unsubscribe();
|
|
4505
|
+
}
|
|
4506
|
+
};
|
|
4507
|
+
});
|
|
5559
4508
|
}
|
|
5560
4509
|
|
|
5561
|
-
// ../core/dist/esm/message/
|
|
5562
|
-
function
|
|
5563
|
-
return (
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
4510
|
+
// ../core/dist/esm/message/internal/merge.js
|
|
4511
|
+
function merge(...observables) {
|
|
4512
|
+
return new Observable((subscriber) => {
|
|
4513
|
+
if (observables.length === 0) {
|
|
4514
|
+
subscriber.complete();
|
|
4515
|
+
return;
|
|
4516
|
+
}
|
|
4517
|
+
let completedCount = 0;
|
|
4518
|
+
const subscriptions = [];
|
|
4519
|
+
for (const observable of observables) {
|
|
4520
|
+
const subscription = observable.subscribe({
|
|
5568
4521
|
next: (value) => {
|
|
5569
|
-
|
|
5570
|
-
if (skipping && predicate(value, index++)) {
|
|
5571
|
-
} else {
|
|
5572
|
-
skipping = false;
|
|
5573
|
-
subscriber.next(value);
|
|
5574
|
-
}
|
|
5575
|
-
} catch (err) {
|
|
5576
|
-
subscriber.error(err);
|
|
5577
|
-
}
|
|
4522
|
+
subscriber.next(value);
|
|
5578
4523
|
},
|
|
5579
4524
|
error: (err) => {
|
|
5580
4525
|
subscriber.error(err);
|
|
5581
4526
|
},
|
|
5582
4527
|
complete: () => {
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
return () => {
|
|
5587
|
-
sourceSubscription.unsubscribe();
|
|
5588
|
-
};
|
|
5589
|
-
});
|
|
5590
|
-
};
|
|
5591
|
-
}
|
|
5592
|
-
|
|
5593
|
-
// ../core/dist/esm/message/operators/throttle.js
|
|
5594
|
-
function throttle(durationSelector, config) {
|
|
5595
|
-
const leading = config?.leading ?? true;
|
|
5596
|
-
const trailing = config?.trailing ?? false;
|
|
5597
|
-
return (source) => {
|
|
5598
|
-
return new Observable((subscriber) => {
|
|
5599
|
-
let throttled = false;
|
|
5600
|
-
let trailingValue;
|
|
5601
|
-
let hasTrailingValue = false;
|
|
5602
|
-
let durationSubscription = null;
|
|
5603
|
-
let isEndingThrottle = false;
|
|
5604
|
-
const endThrottle = () => {
|
|
5605
|
-
if (isEndingThrottle) {
|
|
5606
|
-
return;
|
|
5607
|
-
}
|
|
5608
|
-
isEndingThrottle = true;
|
|
5609
|
-
if (durationSubscription) {
|
|
5610
|
-
durationSubscription.unsubscribe();
|
|
5611
|
-
durationSubscription = null;
|
|
5612
|
-
}
|
|
5613
|
-
throttled = false;
|
|
5614
|
-
if (trailing && hasTrailingValue) {
|
|
5615
|
-
const valueToEmit = trailingValue;
|
|
5616
|
-
hasTrailingValue = false;
|
|
5617
|
-
trailingValue = void 0;
|
|
5618
|
-
Promise.resolve().then(() => {
|
|
5619
|
-
isEndingThrottle = false;
|
|
5620
|
-
if (!subscriber.closed) {
|
|
5621
|
-
subscriber.next(valueToEmit);
|
|
5622
|
-
startThrottle(valueToEmit);
|
|
5623
|
-
}
|
|
5624
|
-
});
|
|
5625
|
-
} else {
|
|
5626
|
-
isEndingThrottle = false;
|
|
5627
|
-
}
|
|
5628
|
-
};
|
|
5629
|
-
const startThrottle = (value) => {
|
|
5630
|
-
if (throttled) {
|
|
5631
|
-
return;
|
|
5632
|
-
}
|
|
5633
|
-
throttled = true;
|
|
5634
|
-
try {
|
|
5635
|
-
const duration = durationSelector(value);
|
|
5636
|
-
durationSubscription = duration.subscribe({
|
|
5637
|
-
next: () => {
|
|
5638
|
-
endThrottle();
|
|
5639
|
-
},
|
|
5640
|
-
error: (err) => {
|
|
5641
|
-
throttled = false;
|
|
5642
|
-
if (durationSubscription) {
|
|
5643
|
-
durationSubscription.unsubscribe();
|
|
5644
|
-
durationSubscription = null;
|
|
5645
|
-
}
|
|
5646
|
-
subscriber.error(err);
|
|
5647
|
-
},
|
|
5648
|
-
complete: () => {
|
|
5649
|
-
endThrottle();
|
|
5650
|
-
}
|
|
5651
|
-
});
|
|
5652
|
-
} catch (err) {
|
|
5653
|
-
throttled = false;
|
|
5654
|
-
subscriber.error(err);
|
|
5655
|
-
}
|
|
5656
|
-
};
|
|
5657
|
-
const sourceSubscription = source.subscribe({
|
|
5658
|
-
next: (value) => {
|
|
5659
|
-
if (!throttled) {
|
|
5660
|
-
if (leading) {
|
|
5661
|
-
subscriber.next(value);
|
|
5662
|
-
} else if (trailing) {
|
|
5663
|
-
trailingValue = value;
|
|
5664
|
-
hasTrailingValue = true;
|
|
5665
|
-
}
|
|
5666
|
-
startThrottle(value);
|
|
5667
|
-
} else if (trailing) {
|
|
5668
|
-
trailingValue = value;
|
|
5669
|
-
hasTrailingValue = true;
|
|
4528
|
+
completedCount++;
|
|
4529
|
+
if (completedCount === observables.length) {
|
|
4530
|
+
subscriber.complete();
|
|
5670
4531
|
}
|
|
5671
|
-
},
|
|
5672
|
-
error: (err) => {
|
|
5673
|
-
subscriber.error(err);
|
|
5674
|
-
},
|
|
5675
|
-
complete: () => {
|
|
5676
|
-
subscriber.complete();
|
|
5677
4532
|
}
|
|
5678
4533
|
});
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
});
|
|
5686
|
-
};
|
|
4534
|
+
subscriptions.push(subscription);
|
|
4535
|
+
}
|
|
4536
|
+
return () => {
|
|
4537
|
+
subscriptions.forEach((sub) => sub.unsubscribe());
|
|
4538
|
+
};
|
|
4539
|
+
});
|
|
5687
4540
|
}
|
|
5688
4541
|
|
|
5689
|
-
// ../core/dist/esm/message/
|
|
5690
|
-
function
|
|
4542
|
+
// ../core/dist/esm/message/internal/fromEvent.js
|
|
4543
|
+
function fromEvent(target, eventName) {
|
|
5691
4544
|
return new Observable((subscriber) => {
|
|
5692
|
-
const
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
subscriber.next(count++);
|
|
5697
|
-
}, period);
|
|
4545
|
+
const handler = (event) => {
|
|
4546
|
+
subscriber.next(event);
|
|
4547
|
+
};
|
|
4548
|
+
target.addEventListener(eventName, handler);
|
|
5698
4549
|
return () => {
|
|
5699
|
-
|
|
4550
|
+
target.removeEventListener(eventName, handler);
|
|
5700
4551
|
};
|
|
5701
4552
|
});
|
|
5702
4553
|
}
|
|
5703
4554
|
|
|
4555
|
+
// ../core/dist/esm/message/internal/toPromise.js
|
|
4556
|
+
function toPromise(source) {
|
|
4557
|
+
return new Promise((resolve, reject) => {
|
|
4558
|
+
let _hasValue = false;
|
|
4559
|
+
let _value;
|
|
4560
|
+
source.subscribe({
|
|
4561
|
+
next: (value) => {
|
|
4562
|
+
_value = value;
|
|
4563
|
+
_hasValue = true;
|
|
4564
|
+
},
|
|
4565
|
+
error: reject,
|
|
4566
|
+
complete: () => {
|
|
4567
|
+
if (_hasValue) {
|
|
4568
|
+
resolve(_value);
|
|
4569
|
+
} else {
|
|
4570
|
+
reject(new EmptyError());
|
|
4571
|
+
}
|
|
4572
|
+
}
|
|
4573
|
+
});
|
|
4574
|
+
});
|
|
4575
|
+
}
|
|
4576
|
+
|
|
5704
4577
|
// ../core/dist/esm/message/index.js
|
|
5705
4578
|
var debounceTimeIntervalLock = (unlockChecker, unlocked, intervalTime, config) => {
|
|
5706
4579
|
const clearIntervalFn = config?.clearInterval || clearInterval;
|
|
@@ -5713,7 +4586,7 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5713
4586
|
}, intervalTime);
|
|
5714
4587
|
return nextIntervalId;
|
|
5715
4588
|
};
|
|
5716
|
-
var debounce = (fn,
|
|
4589
|
+
var debounce = (fn, delay, config) => {
|
|
5717
4590
|
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
5718
4591
|
const clearTimeoutFn = config?.clearTimeout || clearTimeout;
|
|
5719
4592
|
let timer2 = null;
|
|
@@ -5724,10 +4597,10 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5724
4597
|
timer2 = setTimeoutFn(() => {
|
|
5725
4598
|
fn(data);
|
|
5726
4599
|
timer2 = null;
|
|
5727
|
-
},
|
|
4600
|
+
}, delay);
|
|
5728
4601
|
};
|
|
5729
4602
|
};
|
|
5730
|
-
var throttleTime = (fn,
|
|
4603
|
+
var throttleTime = (fn, delay, config) => {
|
|
5731
4604
|
const setTimeoutFn = config?.setTimeout || setTimeout;
|
|
5732
4605
|
let timer2 = null;
|
|
5733
4606
|
return (...args) => {
|
|
@@ -5735,15 +4608,15 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5735
4608
|
timer2 = setTimeoutFn(() => {
|
|
5736
4609
|
fn(...args);
|
|
5737
4610
|
timer2 = null;
|
|
5738
|
-
},
|
|
4611
|
+
}, delay);
|
|
5739
4612
|
}
|
|
5740
4613
|
};
|
|
5741
4614
|
};
|
|
5742
|
-
var
|
|
4615
|
+
var throttle = (fn, delay) => {
|
|
5743
4616
|
let lastTime = 0;
|
|
5744
4617
|
return (...args) => {
|
|
5745
4618
|
const now = Date.now();
|
|
5746
|
-
if (now - lastTime >=
|
|
4619
|
+
if (now - lastTime >= delay) {
|
|
5747
4620
|
fn(...args);
|
|
5748
4621
|
lastTime = now;
|
|
5749
4622
|
}
|
|
@@ -5853,7 +4726,7 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5853
4726
|
} catch (e) {
|
|
5854
4727
|
const targetHas = Array.isArray(has) ? has : [has];
|
|
5855
4728
|
for (let ha of targetHas) {
|
|
5856
|
-
if (ValidUtils.
|
|
4729
|
+
if (ValidUtils.isFunctionType(ha)) {
|
|
5857
4730
|
if (e instanceof ha) {
|
|
5858
4731
|
return e;
|
|
5859
4732
|
}
|
|
@@ -5909,12 +4782,12 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
5909
4782
|
}
|
|
5910
4783
|
};
|
|
5911
4784
|
};
|
|
5912
|
-
Promises2.delayExecute = (value,
|
|
4785
|
+
Promises2.delayExecute = (value, delay = 0) => {
|
|
5913
4786
|
return new Promise((resolve) => {
|
|
5914
4787
|
setTimeout(async () => {
|
|
5915
4788
|
const t = await value();
|
|
5916
4789
|
resolve(t);
|
|
5917
|
-
},
|
|
4790
|
+
}, delay);
|
|
5918
4791
|
});
|
|
5919
4792
|
};
|
|
5920
4793
|
Promises2.abortable = (executor, signal) => {
|
|
@@ -8406,7 +7279,7 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8406
7279
|
|
|
8407
7280
|
// ../core/dist/esm/url/UrlUtils.js
|
|
8408
7281
|
var UrlUtils;
|
|
8409
|
-
((UrlUtils2)
|
|
7282
|
+
(function(UrlUtils2) {
|
|
8410
7283
|
UrlUtils2.origin = (fullurl) => {
|
|
8411
7284
|
return new URL(fullurl).origin;
|
|
8412
7285
|
};
|
|
@@ -8444,15 +7317,28 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8444
7317
|
});
|
|
8445
7318
|
return searchParams;
|
|
8446
7319
|
};
|
|
7320
|
+
UrlUtils2.toAbsoluteUrl = (relative, base) => {
|
|
7321
|
+
return new URL(relative, base);
|
|
7322
|
+
};
|
|
7323
|
+
function toAbsoluteRequest(input, base) {
|
|
7324
|
+
if (input instanceof URL) {
|
|
7325
|
+
return UrlUtils2.toAbsoluteUrl(input.href, base);
|
|
7326
|
+
}
|
|
7327
|
+
if (typeof input === "string") {
|
|
7328
|
+
return UrlUtils2.toAbsoluteUrl(input, base).href;
|
|
7329
|
+
}
|
|
7330
|
+
return new Request(UrlUtils2.toAbsoluteUrl(input.url, base).href, input);
|
|
7331
|
+
}
|
|
7332
|
+
UrlUtils2.toAbsoluteRequest = toAbsoluteRequest;
|
|
8447
7333
|
UrlUtils2.manipulateSearchParams = (searchParams, options) => {
|
|
8448
7334
|
if (options?.delete) {
|
|
8449
|
-
|
|
7335
|
+
UrlUtils2.deleteSearchParam(searchParams, options.delete);
|
|
8450
7336
|
}
|
|
8451
7337
|
if (options?.append) {
|
|
8452
|
-
|
|
7338
|
+
UrlUtils2.appendSearchParam(searchParams, options.append);
|
|
8453
7339
|
}
|
|
8454
7340
|
if (options?.upsert) {
|
|
8455
|
-
|
|
7341
|
+
UrlUtils2.upsertSearchParam(searchParams, options.upsert);
|
|
8456
7342
|
}
|
|
8457
7343
|
return searchParams;
|
|
8458
7344
|
};
|
|
@@ -8770,10 +7656,10 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8770
7656
|
Reflect.defineMetadata(metadataKey, value, target);
|
|
8771
7657
|
}
|
|
8772
7658
|
};
|
|
8773
|
-
ReflectUtils2.copyMetadata = (
|
|
8774
|
-
const keys = propertyKey ? Reflect.getOwnMetadataKeys(
|
|
7659
|
+
ReflectUtils2.copyMetadata = (from, to, propertyKey) => {
|
|
7660
|
+
const keys = propertyKey ? Reflect.getOwnMetadataKeys(from, propertyKey) : Reflect.getOwnMetadataKeys(from);
|
|
8775
7661
|
for (const key of keys) {
|
|
8776
|
-
const data = propertyKey ? Reflect.getOwnMetadata(key,
|
|
7662
|
+
const data = propertyKey ? Reflect.getOwnMetadata(key, from, propertyKey) : Reflect.getOwnMetadata(key, from);
|
|
8777
7663
|
if (propertyKey) {
|
|
8778
7664
|
Reflect.defineMetadata(key, data, to, propertyKey);
|
|
8779
7665
|
} else {
|
|
@@ -8873,8 +7759,8 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8873
7759
|
}
|
|
8874
7760
|
};
|
|
8875
7761
|
var RangeIterator = class {
|
|
8876
|
-
constructor(
|
|
8877
|
-
this._current = this._first =
|
|
7762
|
+
constructor(first, last, step) {
|
|
7763
|
+
this._current = this._first = first;
|
|
8878
7764
|
this._last = last;
|
|
8879
7765
|
this._step = step;
|
|
8880
7766
|
}
|
|
@@ -8902,8 +7788,8 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8902
7788
|
}
|
|
8903
7789
|
};
|
|
8904
7790
|
var Range = class _Range {
|
|
8905
|
-
constructor(
|
|
8906
|
-
this.first =
|
|
7791
|
+
constructor(first, last, step = 1) {
|
|
7792
|
+
this.first = first;
|
|
8907
7793
|
this.last = last;
|
|
8908
7794
|
this.step = step;
|
|
8909
7795
|
this.isRange = true;
|
|
@@ -8914,15 +7800,15 @@ var dooboostoreSimpleBootHttpServerWebSocketClient = (() => {
|
|
|
8914
7800
|
map(callbackfn, thisArg) {
|
|
8915
7801
|
return Array.from(this).map(callbackfn);
|
|
8916
7802
|
}
|
|
8917
|
-
static range(
|
|
8918
|
-
if (typeof
|
|
8919
|
-
return new _Range(0,
|
|
8920
|
-
} else if (typeof
|
|
8921
|
-
const [_first, _last = "0"] =
|
|
7803
|
+
static range(first, last, step = 1) {
|
|
7804
|
+
if (typeof first === "number" && last === void 0) {
|
|
7805
|
+
return new _Range(0, first, step);
|
|
7806
|
+
} else if (typeof first === "string") {
|
|
7807
|
+
const [_first, _last = "0"] = first.split("..");
|
|
8922
7808
|
const [__last, _step = "1"] = _last.split(",");
|
|
8923
7809
|
return new _Range(Number(_first.trim()), Number(__last.trim()), Number(_step.trim()));
|
|
8924
7810
|
} else {
|
|
8925
|
-
return new _Range(
|
|
7811
|
+
return new _Range(first, last ?? 0, step);
|
|
8926
7812
|
}
|
|
8927
7813
|
}
|
|
8928
7814
|
};
|
|
@@ -10846,6 +9732,50 @@ ${indentStr}}`;
|
|
|
10846
9732
|
};
|
|
10847
9733
|
}
|
|
10848
9734
|
|
|
9735
|
+
// ../core/dist/esm/hash/HashUtils.js
|
|
9736
|
+
var HashUtils;
|
|
9737
|
+
((HashUtils2) => {
|
|
9738
|
+
const core53 = (str, seed) => {
|
|
9739
|
+
let h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;
|
|
9740
|
+
for (let i = 0; i < str.length; i++) {
|
|
9741
|
+
const ch = str.charCodeAt(i);
|
|
9742
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
9743
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
9744
|
+
}
|
|
9745
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
9746
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
9747
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16).padStart(14, "0");
|
|
9748
|
+
};
|
|
9749
|
+
HashUtils2.hash53 = (str, seed = 0, xyz = 16) => `${core53(str, seed)}${core53(str, seed + 1)}`.slice(0, Math.max(1, xyz));
|
|
9750
|
+
})(HashUtils || (HashUtils = {}));
|
|
9751
|
+
|
|
9752
|
+
// ../core/dist/esm/message/operators/filter.js
|
|
9753
|
+
function filter(predicate) {
|
|
9754
|
+
return (source) => {
|
|
9755
|
+
return new Observable((subscriber) => {
|
|
9756
|
+
let index = 0;
|
|
9757
|
+
const subscription = source.subscribe({
|
|
9758
|
+
next: (value) => {
|
|
9759
|
+
try {
|
|
9760
|
+
if (predicate(value, index++)) {
|
|
9761
|
+
subscriber.next(value);
|
|
9762
|
+
}
|
|
9763
|
+
} catch (err) {
|
|
9764
|
+
subscriber.error(err);
|
|
9765
|
+
}
|
|
9766
|
+
},
|
|
9767
|
+
error: (err) => {
|
|
9768
|
+
subscriber.error(err);
|
|
9769
|
+
},
|
|
9770
|
+
complete: () => {
|
|
9771
|
+
subscriber.complete();
|
|
9772
|
+
}
|
|
9773
|
+
});
|
|
9774
|
+
return subscription;
|
|
9775
|
+
});
|
|
9776
|
+
};
|
|
9777
|
+
}
|
|
9778
|
+
|
|
10849
9779
|
// src/websocket/WebSocketClient.ts
|
|
10850
9780
|
var WebSocketClient = class {
|
|
10851
9781
|
constructor(connection, config) {
|
|
@@ -11312,7 +10242,7 @@ ${indentStr}}`;
|
|
|
11312
10242
|
const value = { type: option?.type, uuid, requestUUID, body };
|
|
11313
10243
|
self.sendMessage(value);
|
|
11314
10244
|
}
|
|
11315
|
-
return topicSubject.pipe(
|
|
10245
|
+
return topicSubject.pipe(filter((data) => data && data.requestUUID === requestUUID));
|
|
11316
10246
|
},
|
|
11317
10247
|
onUnsubscribe: (callback) => {
|
|
11318
10248
|
onUnsubscribes.push(callback);
|