@everyonesoftware/common 5.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/outputs/characterWriteStream-ogvZec-U.d.cts +798 -0
- package/outputs/characterWriteStream-ogvZec-U.d.ts +798 -0
- package/outputs/{chunk-AY3YWKOM.js → chunk-MMAX3IZF.js} +4911 -3470
- package/outputs/chunk-MMAX3IZF.js.map +1 -0
- package/outputs/chunk-VF6FBNAU.js +1062 -0
- package/outputs/chunk-VF6FBNAU.js.map +1 -0
- package/outputs/{sources.cjs → sourceIndex.cjs} +926 -560
- package/outputs/sourceIndex.cjs.map +1 -0
- package/outputs/{sources.d.cts → sourceIndex.d.cts} +457 -1160
- package/outputs/{sources.d.ts → sourceIndex.d.ts} +457 -1160
- package/outputs/sourceIndex.js +331 -0
- package/outputs/sourceIndex.js.map +1 -0
- package/outputs/testIndex.cjs +6522 -0
- package/outputs/testIndex.cjs.map +1 -0
- package/outputs/testIndex.d.cts +476 -0
- package/outputs/testIndex.d.ts +476 -0
- package/outputs/testIndex.js +26 -0
- package/outputs/testIndex.js.map +1 -0
- package/outputs/tests.cjs +13935 -12780
- package/outputs/tests.cjs.map +1 -1
- package/outputs/tests.js +2763 -3032
- package/outputs/tests.js.map +1 -1
- package/package.json +7 -7
- package/outputs/chunk-AY3YWKOM.js.map +0 -1
- package/outputs/sources.cjs.map +0 -1
- package/outputs/sources.js +0 -1370
- package/outputs/sources.js.map +0 -1
package/outputs/sources.js
DELETED
|
@@ -1,1370 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ByteList,
|
|
3
|
-
ByteListStream,
|
|
4
|
-
Bytes,
|
|
5
|
-
CharacterList,
|
|
6
|
-
CharacterListStream,
|
|
7
|
-
CharacterReadStream,
|
|
8
|
-
CharacterWriteStream,
|
|
9
|
-
CommandLineParameters,
|
|
10
|
-
Comparer,
|
|
11
|
-
Comparison,
|
|
12
|
-
ConcatenateIterable,
|
|
13
|
-
ConcatenateIterator,
|
|
14
|
-
Condition,
|
|
15
|
-
CurrentProcess,
|
|
16
|
-
DateTime,
|
|
17
|
-
Disposable,
|
|
18
|
-
EmptyError,
|
|
19
|
-
EqualFunctions,
|
|
20
|
-
FetchHttpClient,
|
|
21
|
-
FetchHttpIncomingResponse,
|
|
22
|
-
FlatMapIterable,
|
|
23
|
-
FlatMapIterator,
|
|
24
|
-
Generator,
|
|
25
|
-
HttpClient,
|
|
26
|
-
HttpHeader,
|
|
27
|
-
HttpHeaders,
|
|
28
|
-
HttpIncomingResponse,
|
|
29
|
-
HttpMethod,
|
|
30
|
-
HttpOutgoingRequest,
|
|
31
|
-
HttpOutgoingResponse,
|
|
32
|
-
HttpServer,
|
|
33
|
-
InMemoryCharacterWriteStream,
|
|
34
|
-
Iterable,
|
|
35
|
-
Iterator,
|
|
36
|
-
IteratorToJavascriptIteratorAdapter,
|
|
37
|
-
JavascriptArrayList,
|
|
38
|
-
JavascriptIteratorToIteratorAdapter,
|
|
39
|
-
JavascriptMap,
|
|
40
|
-
JavascriptMapMap,
|
|
41
|
-
JavascriptSet,
|
|
42
|
-
JavascriptSetSet,
|
|
43
|
-
List,
|
|
44
|
-
ListQueue,
|
|
45
|
-
ListStack,
|
|
46
|
-
LuxonDateTime,
|
|
47
|
-
Map,
|
|
48
|
-
MapIterable,
|
|
49
|
-
MapIterator,
|
|
50
|
-
MutableCondition,
|
|
51
|
-
MutableHttpHeaders,
|
|
52
|
-
MutableMap,
|
|
53
|
-
Network,
|
|
54
|
-
Node,
|
|
55
|
-
NodeJSCharacterWriteStream,
|
|
56
|
-
NodeJSHttpServer,
|
|
57
|
-
NotFoundError,
|
|
58
|
-
PostCondition,
|
|
59
|
-
PostConditionError,
|
|
60
|
-
PreCondition,
|
|
61
|
-
PreConditionError,
|
|
62
|
-
PromiseAsyncResult,
|
|
63
|
-
Property,
|
|
64
|
-
Queue,
|
|
65
|
-
RealNetwork,
|
|
66
|
-
RecreationDotGovClient,
|
|
67
|
-
RecreationDotGovDivisionAvailability,
|
|
68
|
-
RecreationDotGovError,
|
|
69
|
-
Set,
|
|
70
|
-
SkipIterator,
|
|
71
|
-
Stack,
|
|
72
|
-
StringComparer,
|
|
73
|
-
StringIterator,
|
|
74
|
-
SyncDisposable,
|
|
75
|
-
SyncResult,
|
|
76
|
-
TakeIterator,
|
|
77
|
-
ToStringFunctions,
|
|
78
|
-
WhereIterable,
|
|
79
|
-
WhereIterator,
|
|
80
|
-
WonderlandTrailAvailability,
|
|
81
|
-
WonderlandTrailClient,
|
|
82
|
-
WonderlandTrailConnection,
|
|
83
|
-
WonderlandTrailConnections,
|
|
84
|
-
WonderlandTrailDirection,
|
|
85
|
-
WonderlandTrailItinerary,
|
|
86
|
-
WonderlandTrailLocations,
|
|
87
|
-
WonderlandTrailReservationType,
|
|
88
|
-
andList,
|
|
89
|
-
as,
|
|
90
|
-
asArray,
|
|
91
|
-
asBoolean,
|
|
92
|
-
asFunction,
|
|
93
|
-
asFunctionWithParameterCount,
|
|
94
|
-
asNull,
|
|
95
|
-
asNumber,
|
|
96
|
-
asObject,
|
|
97
|
-
asObjectOrArrayOrNull,
|
|
98
|
-
asString,
|
|
99
|
-
depthFirstSearch,
|
|
100
|
-
escape,
|
|
101
|
-
escapeAndQuote,
|
|
102
|
-
getLength,
|
|
103
|
-
getName,
|
|
104
|
-
getParameterCount,
|
|
105
|
-
getPropertyNames,
|
|
106
|
-
hasFunction,
|
|
107
|
-
hasProperty,
|
|
108
|
-
httpMethodToString,
|
|
109
|
-
instanceOf,
|
|
110
|
-
instanceOfType,
|
|
111
|
-
isArray,
|
|
112
|
-
isAsyncIterable,
|
|
113
|
-
isBoolean,
|
|
114
|
-
isDigit,
|
|
115
|
-
isFunction,
|
|
116
|
-
isFunctionWithParameterCount,
|
|
117
|
-
isIterable,
|
|
118
|
-
isJavascriptAsyncIterable,
|
|
119
|
-
isJavascriptAsyncIterator,
|
|
120
|
-
isJavascriptIterable,
|
|
121
|
-
isJavascriptIterator,
|
|
122
|
-
isLetter,
|
|
123
|
-
isLetterOrDigit,
|
|
124
|
-
isLowercasedLetter,
|
|
125
|
-
isMap,
|
|
126
|
-
isMutableMap,
|
|
127
|
-
isNull,
|
|
128
|
-
isNumber,
|
|
129
|
-
isObject,
|
|
130
|
-
isObjectOrArrayOrNull,
|
|
131
|
-
isPromise,
|
|
132
|
-
isPromiseLike,
|
|
133
|
-
isSet,
|
|
134
|
-
isString,
|
|
135
|
-
isUndefined,
|
|
136
|
-
isUndefinedOrNull,
|
|
137
|
-
isUppercasedLetter,
|
|
138
|
-
isWhitespace,
|
|
139
|
-
isWonderlandTrailLocation,
|
|
140
|
-
join,
|
|
141
|
-
orList,
|
|
142
|
-
parseHttpMethod,
|
|
143
|
-
quote,
|
|
144
|
-
toString
|
|
145
|
-
} from "./chunk-AY3YWKOM.js";
|
|
146
|
-
|
|
147
|
-
// sources/asyncIteratorToJavascriptAsyncIteratorAdapter.ts
|
|
148
|
-
var AsyncIteratorToJavascriptAsyncIteratorAdapter = class _AsyncIteratorToJavascriptAsyncIteratorAdapter {
|
|
149
|
-
iterator;
|
|
150
|
-
hasStarted;
|
|
151
|
-
constructor(iterator) {
|
|
152
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
153
|
-
this.iterator = iterator;
|
|
154
|
-
this.hasStarted = false;
|
|
155
|
-
}
|
|
156
|
-
static create(iterator) {
|
|
157
|
-
return new _AsyncIteratorToJavascriptAsyncIteratorAdapter(iterator);
|
|
158
|
-
}
|
|
159
|
-
async next() {
|
|
160
|
-
if (!this.hasStarted) {
|
|
161
|
-
this.hasStarted = true;
|
|
162
|
-
await this.iterator.start();
|
|
163
|
-
} else {
|
|
164
|
-
await this.iterator.next();
|
|
165
|
-
}
|
|
166
|
-
const result = {
|
|
167
|
-
done: !this.iterator.hasCurrent(),
|
|
168
|
-
value: void 0
|
|
169
|
-
};
|
|
170
|
-
if (!result.done) {
|
|
171
|
-
result.value = this.iterator.getCurrent();
|
|
172
|
-
}
|
|
173
|
-
return result;
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// sources/javascriptAsyncIteratorToAsyncIteratorAdapter.ts
|
|
178
|
-
var JavascriptAsyncIteratorToAsyncIteratorAdapter = class _JavascriptAsyncIteratorToAsyncIteratorAdapter {
|
|
179
|
-
javascriptIterator;
|
|
180
|
-
javascriptIteratorResult;
|
|
181
|
-
constructor(javascriptIterator) {
|
|
182
|
-
PreCondition.assertNotUndefinedAndNotNull(javascriptIterator, "javascriptIterator");
|
|
183
|
-
this.javascriptIterator = javascriptIterator;
|
|
184
|
-
}
|
|
185
|
-
static create(javascriptIterator) {
|
|
186
|
-
if (isJavascriptAsyncIterable(javascriptIterator)) {
|
|
187
|
-
javascriptIterator = javascriptIterator[Symbol.asyncIterator]();
|
|
188
|
-
}
|
|
189
|
-
return new _JavascriptAsyncIteratorToAsyncIteratorAdapter(javascriptIterator);
|
|
190
|
-
}
|
|
191
|
-
next() {
|
|
192
|
-
return PromiseAsyncResult.create(async () => {
|
|
193
|
-
this.javascriptIteratorResult = await this.javascriptIterator.next();
|
|
194
|
-
return this.hasCurrent();
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
hasStarted() {
|
|
198
|
-
return this.javascriptIteratorResult !== void 0;
|
|
199
|
-
}
|
|
200
|
-
hasCurrent() {
|
|
201
|
-
return this.javascriptIteratorResult?.done === false;
|
|
202
|
-
}
|
|
203
|
-
getCurrent() {
|
|
204
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
205
|
-
return this.javascriptIteratorResult.value;
|
|
206
|
-
}
|
|
207
|
-
start() {
|
|
208
|
-
return AsyncIterator.start(this);
|
|
209
|
-
}
|
|
210
|
-
takeCurrent() {
|
|
211
|
-
return AsyncIterator.takeCurrent(this);
|
|
212
|
-
}
|
|
213
|
-
any() {
|
|
214
|
-
return AsyncIterator.any(this);
|
|
215
|
-
}
|
|
216
|
-
getCount() {
|
|
217
|
-
return AsyncIterator.getCount(this);
|
|
218
|
-
}
|
|
219
|
-
toArray() {
|
|
220
|
-
return AsyncIterator.toArray(this);
|
|
221
|
-
}
|
|
222
|
-
map(mapping) {
|
|
223
|
-
return AsyncIterator.map(this, mapping);
|
|
224
|
-
}
|
|
225
|
-
[Symbol.asyncIterator]() {
|
|
226
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
227
|
-
}
|
|
228
|
-
first(condition) {
|
|
229
|
-
return AsyncIterator.first(this, condition);
|
|
230
|
-
}
|
|
231
|
-
last(condition) {
|
|
232
|
-
return AsyncIterator.last(this, condition);
|
|
233
|
-
}
|
|
234
|
-
where(condition) {
|
|
235
|
-
return AsyncIterator.where(this, condition);
|
|
236
|
-
}
|
|
237
|
-
whereInstanceOf(typeCheck) {
|
|
238
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
239
|
-
}
|
|
240
|
-
whereInstanceOfType(type) {
|
|
241
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
242
|
-
}
|
|
243
|
-
take(maximumToTake) {
|
|
244
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
245
|
-
}
|
|
246
|
-
skip(maximumToSkip) {
|
|
247
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
// sources/mapAsyncIterator.ts
|
|
252
|
-
var MapAsyncIterator = class _MapAsyncIterator {
|
|
253
|
-
inputIterator;
|
|
254
|
-
mapping;
|
|
255
|
-
current;
|
|
256
|
-
started;
|
|
257
|
-
constructor(inputIterator, mapping) {
|
|
258
|
-
PreCondition.assertNotUndefinedAndNotNull(inputIterator, "inputIterator");
|
|
259
|
-
PreCondition.assertNotUndefinedAndNotNull(mapping, "mapping");
|
|
260
|
-
this.inputIterator = inputIterator;
|
|
261
|
-
this.mapping = mapping;
|
|
262
|
-
this.started = false;
|
|
263
|
-
}
|
|
264
|
-
static create(inputIterator, mapping) {
|
|
265
|
-
return new _MapAsyncIterator(inputIterator, mapping);
|
|
266
|
-
}
|
|
267
|
-
next() {
|
|
268
|
-
return PromiseAsyncResult.create(async () => {
|
|
269
|
-
if (!this.hasStarted()) {
|
|
270
|
-
this.started = true;
|
|
271
|
-
await this.inputIterator.start();
|
|
272
|
-
} else {
|
|
273
|
-
await this.inputIterator.next();
|
|
274
|
-
}
|
|
275
|
-
const result = this.inputIterator.hasCurrent();
|
|
276
|
-
this.current = result ? await this.mapping(this.inputIterator.getCurrent()) : void 0;
|
|
277
|
-
return result;
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
hasStarted() {
|
|
281
|
-
return this.started;
|
|
282
|
-
}
|
|
283
|
-
hasCurrent() {
|
|
284
|
-
return this.hasStarted() && this.inputIterator.hasCurrent();
|
|
285
|
-
}
|
|
286
|
-
getCurrent() {
|
|
287
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
288
|
-
return this.current;
|
|
289
|
-
}
|
|
290
|
-
start() {
|
|
291
|
-
return AsyncIterator.start(this);
|
|
292
|
-
}
|
|
293
|
-
takeCurrent() {
|
|
294
|
-
return AsyncIterator.takeCurrent(this);
|
|
295
|
-
}
|
|
296
|
-
any() {
|
|
297
|
-
return AsyncIterator.any(this);
|
|
298
|
-
}
|
|
299
|
-
getCount() {
|
|
300
|
-
return AsyncIterator.getCount(this);
|
|
301
|
-
}
|
|
302
|
-
toArray() {
|
|
303
|
-
return AsyncIterator.toArray(this);
|
|
304
|
-
}
|
|
305
|
-
map(mapping) {
|
|
306
|
-
return AsyncIterator.map(this, mapping);
|
|
307
|
-
}
|
|
308
|
-
[Symbol.asyncIterator]() {
|
|
309
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
310
|
-
}
|
|
311
|
-
first(condition) {
|
|
312
|
-
return AsyncIterator.first(this, condition);
|
|
313
|
-
}
|
|
314
|
-
last() {
|
|
315
|
-
return AsyncIterator.last(this);
|
|
316
|
-
}
|
|
317
|
-
where(condition) {
|
|
318
|
-
return AsyncIterator.where(this, condition);
|
|
319
|
-
}
|
|
320
|
-
whereInstanceOf(typeCheck) {
|
|
321
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
322
|
-
}
|
|
323
|
-
whereInstanceOfType(type) {
|
|
324
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
325
|
-
}
|
|
326
|
-
take(maximumToTake) {
|
|
327
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
328
|
-
}
|
|
329
|
-
skip(maximumToSkip) {
|
|
330
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
// sources/skipAsyncIterator.ts
|
|
335
|
-
var SkipAsyncIterator = class _SkipAsyncIterator {
|
|
336
|
-
innerIterator;
|
|
337
|
-
started;
|
|
338
|
-
maximumToSkip;
|
|
339
|
-
constructor(innerIterator, maximumToSkip) {
|
|
340
|
-
PreCondition.assertNotUndefinedAndNotNull(innerIterator, "innerIterator");
|
|
341
|
-
PreCondition.assertNotUndefinedAndNotNull(maximumToSkip, "maximumToSkip");
|
|
342
|
-
PreCondition.assertInteger(maximumToSkip, "maximumToSkip");
|
|
343
|
-
PreCondition.assertGreaterThanOrEqualTo(maximumToSkip, 0, "maximumToSkip");
|
|
344
|
-
this.innerIterator = innerIterator;
|
|
345
|
-
this.started = false;
|
|
346
|
-
this.maximumToSkip = maximumToSkip;
|
|
347
|
-
}
|
|
348
|
-
static create(innerIterator, maximumToSkip) {
|
|
349
|
-
return new _SkipAsyncIterator(innerIterator, maximumToSkip);
|
|
350
|
-
}
|
|
351
|
-
next() {
|
|
352
|
-
return PromiseAsyncResult.create(async () => {
|
|
353
|
-
if (!this.hasStarted()) {
|
|
354
|
-
this.started = true;
|
|
355
|
-
await this.innerIterator.start();
|
|
356
|
-
for (let i = 0; i < this.maximumToSkip; i++) {
|
|
357
|
-
if (!await this.innerIterator.next()) {
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
} else {
|
|
362
|
-
await this.innerIterator.next();
|
|
363
|
-
}
|
|
364
|
-
return this.hasCurrent();
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
hasStarted() {
|
|
368
|
-
return this.started;
|
|
369
|
-
}
|
|
370
|
-
hasCurrent() {
|
|
371
|
-
return this.hasStarted() && this.innerIterator.hasCurrent();
|
|
372
|
-
}
|
|
373
|
-
getCurrent() {
|
|
374
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
375
|
-
return this.innerIterator.getCurrent();
|
|
376
|
-
}
|
|
377
|
-
start() {
|
|
378
|
-
return AsyncIterator.start(this);
|
|
379
|
-
}
|
|
380
|
-
takeCurrent() {
|
|
381
|
-
return AsyncIterator.takeCurrent(this);
|
|
382
|
-
}
|
|
383
|
-
any() {
|
|
384
|
-
return AsyncIterator.any(this);
|
|
385
|
-
}
|
|
386
|
-
getCount() {
|
|
387
|
-
return AsyncIterator.getCount(this);
|
|
388
|
-
}
|
|
389
|
-
toArray() {
|
|
390
|
-
return AsyncIterator.toArray(this);
|
|
391
|
-
}
|
|
392
|
-
where(condition) {
|
|
393
|
-
return AsyncIterator.where(this, condition);
|
|
394
|
-
}
|
|
395
|
-
whereInstanceOf(typeCheck) {
|
|
396
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
397
|
-
}
|
|
398
|
-
whereInstanceOfType(type) {
|
|
399
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
400
|
-
}
|
|
401
|
-
map(mapping) {
|
|
402
|
-
return AsyncIterator.map(this, mapping);
|
|
403
|
-
}
|
|
404
|
-
first(condition) {
|
|
405
|
-
return AsyncIterator.first(this, condition);
|
|
406
|
-
}
|
|
407
|
-
last(condition) {
|
|
408
|
-
return AsyncIterator.last(this, condition);
|
|
409
|
-
}
|
|
410
|
-
[Symbol.asyncIterator]() {
|
|
411
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
412
|
-
}
|
|
413
|
-
take(maximumToTake) {
|
|
414
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
415
|
-
}
|
|
416
|
-
skip(maximumToSkip) {
|
|
417
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
// sources/takeAsyncIterator.ts
|
|
422
|
-
var TakeAsyncIterator = class _TakeAsyncIterator {
|
|
423
|
-
innerIterator;
|
|
424
|
-
started;
|
|
425
|
-
maximumToTake;
|
|
426
|
-
taken;
|
|
427
|
-
constructor(innerIterator, maximumToTake) {
|
|
428
|
-
PreCondition.assertGreaterThanOrEqualTo(maximumToTake, 0, "maximumToTake");
|
|
429
|
-
this.innerIterator = innerIterator;
|
|
430
|
-
this.started = false;
|
|
431
|
-
this.maximumToTake = maximumToTake;
|
|
432
|
-
this.taken = 0;
|
|
433
|
-
}
|
|
434
|
-
static create(innerIterator, maximumToTake) {
|
|
435
|
-
return new _TakeAsyncIterator(innerIterator, maximumToTake);
|
|
436
|
-
}
|
|
437
|
-
hasCurrent() {
|
|
438
|
-
return this.hasStarted() && this.taken <= this.maximumToTake && this.innerIterator.hasCurrent();
|
|
439
|
-
}
|
|
440
|
-
next() {
|
|
441
|
-
return PromiseAsyncResult.create(async () => {
|
|
442
|
-
if (this.maximumToTake <= 0) {
|
|
443
|
-
return false;
|
|
444
|
-
} else if (!this.hasStarted()) {
|
|
445
|
-
this.started = true;
|
|
446
|
-
await this.innerIterator.start();
|
|
447
|
-
this.taken++;
|
|
448
|
-
} else if (this.taken <= this.maximumToTake) {
|
|
449
|
-
await this.innerIterator.next();
|
|
450
|
-
this.taken++;
|
|
451
|
-
}
|
|
452
|
-
return this.hasCurrent();
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
hasStarted() {
|
|
456
|
-
return this.started;
|
|
457
|
-
}
|
|
458
|
-
getCurrent() {
|
|
459
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
460
|
-
return this.innerIterator.getCurrent();
|
|
461
|
-
}
|
|
462
|
-
start() {
|
|
463
|
-
return AsyncIterator.start(this);
|
|
464
|
-
}
|
|
465
|
-
takeCurrent() {
|
|
466
|
-
return AsyncIterator.takeCurrent(this);
|
|
467
|
-
}
|
|
468
|
-
any() {
|
|
469
|
-
return AsyncIterator.any(this);
|
|
470
|
-
}
|
|
471
|
-
getCount() {
|
|
472
|
-
return AsyncIterator.getCount(this);
|
|
473
|
-
}
|
|
474
|
-
toArray() {
|
|
475
|
-
return AsyncIterator.toArray(this);
|
|
476
|
-
}
|
|
477
|
-
where(condition) {
|
|
478
|
-
return AsyncIterator.where(this, condition);
|
|
479
|
-
}
|
|
480
|
-
whereInstanceOf(typeCheck) {
|
|
481
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
482
|
-
}
|
|
483
|
-
whereInstanceOfType(type) {
|
|
484
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
485
|
-
}
|
|
486
|
-
map(mapping) {
|
|
487
|
-
return AsyncIterator.map(this, mapping);
|
|
488
|
-
}
|
|
489
|
-
first(condition) {
|
|
490
|
-
return AsyncIterator.first(this, condition);
|
|
491
|
-
}
|
|
492
|
-
last(condition) {
|
|
493
|
-
return AsyncIterator.last(this, condition);
|
|
494
|
-
}
|
|
495
|
-
[Symbol.asyncIterator]() {
|
|
496
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
497
|
-
}
|
|
498
|
-
take(maximumToTake) {
|
|
499
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
500
|
-
}
|
|
501
|
-
skip(maximumToSkip) {
|
|
502
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
// sources/whereAsyncIterator.ts
|
|
507
|
-
var WhereAsyncIterator = class _WhereAsyncIterator {
|
|
508
|
-
innerIterator;
|
|
509
|
-
started;
|
|
510
|
-
condition;
|
|
511
|
-
constructor(innerIterator, condition) {
|
|
512
|
-
PreCondition.assertNotUndefinedAndNotNull(innerIterator, "innerIterator");
|
|
513
|
-
PreCondition.assertNotUndefinedAndNotNull(condition, "condition");
|
|
514
|
-
this.innerIterator = innerIterator;
|
|
515
|
-
this.started = false;
|
|
516
|
-
this.condition = condition;
|
|
517
|
-
}
|
|
518
|
-
hasStarted() {
|
|
519
|
-
return this.started;
|
|
520
|
-
}
|
|
521
|
-
hasCurrent() {
|
|
522
|
-
return this.hasStarted() && this.innerIterator.hasCurrent();
|
|
523
|
-
}
|
|
524
|
-
getCurrent() {
|
|
525
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
526
|
-
return this.innerIterator.getCurrent();
|
|
527
|
-
}
|
|
528
|
-
static create(innerIterator, condition) {
|
|
529
|
-
return new _WhereAsyncIterator(innerIterator, condition);
|
|
530
|
-
}
|
|
531
|
-
next() {
|
|
532
|
-
return PromiseAsyncResult.create(async () => {
|
|
533
|
-
if (!this.hasStarted()) {
|
|
534
|
-
await this.innerIterator.start();
|
|
535
|
-
this.started = true;
|
|
536
|
-
while (this.hasCurrent() && !await this.condition(this.getCurrent())) {
|
|
537
|
-
await this.innerIterator.next();
|
|
538
|
-
}
|
|
539
|
-
} else {
|
|
540
|
-
do {
|
|
541
|
-
await this.innerIterator.next();
|
|
542
|
-
} while (this.hasCurrent() && !await this.condition(this.getCurrent()));
|
|
543
|
-
}
|
|
544
|
-
return this.hasCurrent();
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
start() {
|
|
548
|
-
return AsyncIterator.start(this);
|
|
549
|
-
}
|
|
550
|
-
takeCurrent() {
|
|
551
|
-
return AsyncIterator.takeCurrent(this);
|
|
552
|
-
}
|
|
553
|
-
any() {
|
|
554
|
-
return AsyncIterator.any(this);
|
|
555
|
-
}
|
|
556
|
-
getCount() {
|
|
557
|
-
return AsyncIterator.getCount(this);
|
|
558
|
-
}
|
|
559
|
-
toArray() {
|
|
560
|
-
return AsyncIterator.toArray(this);
|
|
561
|
-
}
|
|
562
|
-
where(condition) {
|
|
563
|
-
return AsyncIterator.where(this, condition);
|
|
564
|
-
}
|
|
565
|
-
map(mapping) {
|
|
566
|
-
return AsyncIterator.map(this, mapping);
|
|
567
|
-
}
|
|
568
|
-
whereInstanceOf(typeCheck) {
|
|
569
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
570
|
-
}
|
|
571
|
-
whereInstanceOfType(type) {
|
|
572
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
573
|
-
}
|
|
574
|
-
first(condition) {
|
|
575
|
-
return AsyncIterator.first(this, condition);
|
|
576
|
-
}
|
|
577
|
-
last(condition) {
|
|
578
|
-
return AsyncIterator.last(this, condition);
|
|
579
|
-
}
|
|
580
|
-
take(maximumToTake) {
|
|
581
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
582
|
-
}
|
|
583
|
-
skip(maximumToSkip) {
|
|
584
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
585
|
-
}
|
|
586
|
-
[Symbol.asyncIterator]() {
|
|
587
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
// sources/asyncIterator.ts
|
|
592
|
-
var AsyncIterator = class _AsyncIterator {
|
|
593
|
-
static create(iterator) {
|
|
594
|
-
return JavascriptAsyncIteratorToAsyncIteratorAdapter.create(iterator);
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Move to the first value if this {@link AsyncIterator} hasn't started yet.
|
|
598
|
-
* @returns This object for method chaining.
|
|
599
|
-
*/
|
|
600
|
-
start() {
|
|
601
|
-
return _AsyncIterator.start(this);
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Move the provided {@link AsyncIterator} to its first value if it hasn't started yet.
|
|
605
|
-
*/
|
|
606
|
-
static start(iterator) {
|
|
607
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
608
|
-
return PromiseAsyncResult.create(async () => {
|
|
609
|
-
if (!iterator.hasStarted()) {
|
|
610
|
-
await iterator.next();
|
|
611
|
-
}
|
|
612
|
-
return iterator;
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Get the current value from this {@link AsyncIterator} and advance this {@link AsyncIterator} to the
|
|
617
|
-
* next value.
|
|
618
|
-
*/
|
|
619
|
-
takeCurrent() {
|
|
620
|
-
return _AsyncIterator.takeCurrent(this);
|
|
621
|
-
}
|
|
622
|
-
static takeCurrent(iterator) {
|
|
623
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
624
|
-
PreCondition.assertTrue(iterator.hasCurrent(), "iterator.hasCurrent()");
|
|
625
|
-
return PromiseAsyncResult.create(async () => {
|
|
626
|
-
const result = iterator.getCurrent();
|
|
627
|
-
await iterator.next();
|
|
628
|
-
return result;
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
[Symbol.asyncIterator]() {
|
|
632
|
-
return _AsyncIterator[Symbol.asyncIterator](this);
|
|
633
|
-
}
|
|
634
|
-
/**
|
|
635
|
-
* Convert the provided {@link AsyncIterator} to a {@link IteratorToJavascriptIteratorAdapter}.
|
|
636
|
-
* @param iterator The {@link AsyncIterator} to convert.
|
|
637
|
-
*/
|
|
638
|
-
static [Symbol.asyncIterator](iterator) {
|
|
639
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
640
|
-
return AsyncIteratorToJavascriptAsyncIteratorAdapter.create(iterator);
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Get whether this {@link AsyncIterator} contains any values.
|
|
644
|
-
* Note: This may advance the {@link AsyncIterator} to the first value if it hasn't been
|
|
645
|
-
* started yet.
|
|
646
|
-
*/
|
|
647
|
-
any() {
|
|
648
|
-
return _AsyncIterator.any(this);
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Get whether this {@link AsyncIterator} contains any values.
|
|
652
|
-
* Note: This may advance the {@link AsyncIterator} to the first value if it hasn't been
|
|
653
|
-
* started yet.
|
|
654
|
-
*/
|
|
655
|
-
static any(iterator) {
|
|
656
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
657
|
-
return PromiseAsyncResult.create(async () => {
|
|
658
|
-
await iterator.start();
|
|
659
|
-
return iterator.hasCurrent();
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* Get the number of values in this {@link AsyncIterator}.
|
|
664
|
-
* Note: This will consume all of the values in this {@link AsyncIterator}.
|
|
665
|
-
*/
|
|
666
|
-
getCount() {
|
|
667
|
-
return _AsyncIterator.getCount(this);
|
|
668
|
-
}
|
|
669
|
-
/**
|
|
670
|
-
* Get the number of values in the provided {@link AsyncIterator}.
|
|
671
|
-
* Note: This will consume all of the values in the provided {@link AsyncIterator}.
|
|
672
|
-
*/
|
|
673
|
-
static getCount(iterator) {
|
|
674
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
675
|
-
return PromiseAsyncResult.create(async () => {
|
|
676
|
-
let result = 0;
|
|
677
|
-
if (iterator.hasCurrent()) {
|
|
678
|
-
result++;
|
|
679
|
-
}
|
|
680
|
-
while (await iterator.next()) {
|
|
681
|
-
result++;
|
|
682
|
-
}
|
|
683
|
-
return result;
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Get all of the remaining values in this {@link AsyncIterator} in a {@link T} {@link Array}.
|
|
688
|
-
*/
|
|
689
|
-
toArray() {
|
|
690
|
-
return _AsyncIterator.toArray(this);
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Get all of the remaining values in the provided {@link AsyncIterator} in a {@link T}
|
|
694
|
-
* {@link Array}.
|
|
695
|
-
*/
|
|
696
|
-
static toArray(iterator) {
|
|
697
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
698
|
-
return PromiseAsyncResult.create(async () => {
|
|
699
|
-
const result = [];
|
|
700
|
-
if (iterator.hasCurrent()) {
|
|
701
|
-
result.push(iterator.getCurrent());
|
|
702
|
-
}
|
|
703
|
-
while (await iterator.next()) {
|
|
704
|
-
result.push(iterator.getCurrent());
|
|
705
|
-
}
|
|
706
|
-
return result;
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Get an {@link AsyncIterator} that will only return values that match the provided condition.
|
|
711
|
-
* @param condition The condition to run against each of the values in this {@link AsyncIterator}.
|
|
712
|
-
*/
|
|
713
|
-
where(condition) {
|
|
714
|
-
return _AsyncIterator.where(this, condition);
|
|
715
|
-
}
|
|
716
|
-
static where(iterator, condition) {
|
|
717
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
718
|
-
PreCondition.assertNotUndefinedAndNotNull(condition, "condition");
|
|
719
|
-
return WhereAsyncIterator.create(iterator, condition);
|
|
720
|
-
}
|
|
721
|
-
/**
|
|
722
|
-
* Get a {@link MapIterator} that will map all {@link T} values from this {@link AsyncIterator} to
|
|
723
|
-
* {@link TOutput} values.
|
|
724
|
-
* @param mapping The mapping that maps {@link T} values to {@link TOutput} values.
|
|
725
|
-
*/
|
|
726
|
-
map(mapping) {
|
|
727
|
-
return _AsyncIterator.map(this, mapping);
|
|
728
|
-
}
|
|
729
|
-
static map(iterator, mapping) {
|
|
730
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
731
|
-
PreCondition.assertNotUndefinedAndNotNull(mapping, "mapping");
|
|
732
|
-
return MapAsyncIterator.create(iterator, mapping);
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Get an {@link AsyncIterator} that will filter this {@link AsyncIterator} to only the values that are
|
|
736
|
-
* instances of {@link U} based on the provided type check {@link Function}.
|
|
737
|
-
* @param typeCheck The {@link Function} that will be used to determine if values are of type
|
|
738
|
-
* {@link U}.
|
|
739
|
-
*/
|
|
740
|
-
whereInstanceOf(typeCheck) {
|
|
741
|
-
return _AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
742
|
-
}
|
|
743
|
-
static whereInstanceOf(iterator, typeCheck) {
|
|
744
|
-
PreCondition.assertNotUndefinedAndNotNull(typeCheck, "typeCheck");
|
|
745
|
-
return iterator.where(typeCheck).map((value) => value);
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Get an {@link AsyncIterator} that will filter this {@link AsyncIterator} to only the values that are
|
|
749
|
-
* instances of the provided {@link Type}.
|
|
750
|
-
* @param type The type of values to return from the new {@link AsyncIterator}.
|
|
751
|
-
*/
|
|
752
|
-
whereInstanceOfType(type) {
|
|
753
|
-
return _AsyncIterator.whereInstanceOfType(this, type);
|
|
754
|
-
}
|
|
755
|
-
static whereInstanceOfType(iterator, type) {
|
|
756
|
-
PreCondition.assertNotUndefinedAndNotNull(type, "type");
|
|
757
|
-
return iterator.whereInstanceOf((value) => instanceOfType(value, type));
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* If the condition function is undefined, then this function will return the first value in
|
|
761
|
-
* this {@link AsyncIterator}. If this condition function is provided, then this function will return
|
|
762
|
-
* the first value that matches the provided condition.
|
|
763
|
-
* @param condition The condition that the returned value must satisfy.
|
|
764
|
-
*/
|
|
765
|
-
first(condition) {
|
|
766
|
-
return _AsyncIterator.first(this, condition);
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* If the condition function is undefined, then this function will return the first value in
|
|
770
|
-
* the {@link AsyncIterator}. If this condition function is provided, then this function will return
|
|
771
|
-
* the first value that matches the provided condition.
|
|
772
|
-
* @param iterator The {@link AsyncIterator} to get the first value from.
|
|
773
|
-
*/
|
|
774
|
-
static first(iterator, condition) {
|
|
775
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
776
|
-
return PromiseAsyncResult.create(async () => {
|
|
777
|
-
await iterator.start();
|
|
778
|
-
if (isUndefinedOrNull(condition)) {
|
|
779
|
-
if (!iterator.hasCurrent()) {
|
|
780
|
-
throw new EmptyError();
|
|
781
|
-
}
|
|
782
|
-
} else {
|
|
783
|
-
while (iterator.hasCurrent() && !await condition(iterator.getCurrent())) {
|
|
784
|
-
await iterator.next();
|
|
785
|
-
}
|
|
786
|
-
if (!iterator.hasCurrent()) {
|
|
787
|
-
throw new NotFoundError("No value was found in the AsyncIterator that matched the provided condition.");
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
return iterator.getCurrent();
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* If the condition function is undefined, then this function will return the last value in this
|
|
795
|
-
* {@link AsyncIterator}. If this condition function is provided, then this function will return the
|
|
796
|
-
* last value that matches the provided condition.
|
|
797
|
-
* @param condition The condition that the returned value must satisfy.
|
|
798
|
-
*/
|
|
799
|
-
last(condition) {
|
|
800
|
-
return _AsyncIterator.last(this, condition);
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* If the condition function is undefined, then this function will return the last value in the
|
|
804
|
-
* {@link AsyncIterator}. If this condition function is provided, then this function will return the
|
|
805
|
-
* last value that matches the provided condition.
|
|
806
|
-
* @param iterator The {@link AsyncIterator} to get the last value from.
|
|
807
|
-
*/
|
|
808
|
-
static last(iterator, condition) {
|
|
809
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterator");
|
|
810
|
-
return PromiseAsyncResult.create(async () => {
|
|
811
|
-
await iterator.start();
|
|
812
|
-
if (!iterator.hasCurrent()) {
|
|
813
|
-
throw new EmptyError();
|
|
814
|
-
}
|
|
815
|
-
let result;
|
|
816
|
-
let found = false;
|
|
817
|
-
do {
|
|
818
|
-
if (!condition || await condition(iterator.getCurrent())) {
|
|
819
|
-
result = iterator.getCurrent();
|
|
820
|
-
found = true;
|
|
821
|
-
}
|
|
822
|
-
} while (await iterator.next());
|
|
823
|
-
if (!found) {
|
|
824
|
-
if (!condition) {
|
|
825
|
-
throw new EmptyError();
|
|
826
|
-
} else {
|
|
827
|
-
throw new NotFoundError("No value was found in the AsyncIterator that matched the provided condition.");
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
return result;
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
/**
|
|
834
|
-
* Find the maximum value in the provided {@link AsyncIterator}.
|
|
835
|
-
* @param iterator The values to find the maximum of.
|
|
836
|
-
*/
|
|
837
|
-
static findMaximum(iterator) {
|
|
838
|
-
PreCondition.assertNotUndefinedAndNotNull(iterator, "iterable");
|
|
839
|
-
return PromiseAsyncResult.create(async () => {
|
|
840
|
-
if (isJavascriptAsyncIterator(iterator)) {
|
|
841
|
-
iterator = _AsyncIterator.create(iterator);
|
|
842
|
-
}
|
|
843
|
-
let result = await iterator.first().convertError(EmptyError, () => new EmptyError("Can't find the maximum of an empty Iterator."));
|
|
844
|
-
while (await iterator.next()) {
|
|
845
|
-
const currentValue = iterator.getCurrent();
|
|
846
|
-
if (result.lessThan(currentValue)) {
|
|
847
|
-
result = currentValue;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
return result;
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
/**
|
|
854
|
-
* Get a new {@link AsyncIterator} that wraps around this {@link AsyncIterator} and only
|
|
855
|
-
* returns a maximum number of values from this {@link AsyncIterator}.
|
|
856
|
-
* @param maximumToTake The maximum number of values to take from this {@link AsyncIterator}.
|
|
857
|
-
*/
|
|
858
|
-
take(maximumToTake) {
|
|
859
|
-
return _AsyncIterator.take(this, maximumToTake);
|
|
860
|
-
}
|
|
861
|
-
static take(iterator, maximumToTake) {
|
|
862
|
-
return TakeAsyncIterator.create(iterator, maximumToTake);
|
|
863
|
-
}
|
|
864
|
-
/**
|
|
865
|
-
* Get a new {@link AsyncIterator} that wraps around this {@link AsyncIterator} and will skip the initial
|
|
866
|
-
* provided number of values before beginning to return values.
|
|
867
|
-
* @param maximumToSkip The maximum number of values to skip from this {@link AsyncIterator}.
|
|
868
|
-
*/
|
|
869
|
-
skip(maximumToSkip) {
|
|
870
|
-
return _AsyncIterator.skip(this, maximumToSkip);
|
|
871
|
-
}
|
|
872
|
-
static skip(iterator, maximumToSkip) {
|
|
873
|
-
return SkipAsyncIterator.create(iterator, maximumToSkip);
|
|
874
|
-
}
|
|
875
|
-
};
|
|
876
|
-
|
|
877
|
-
// sources/asyncResult.ts
|
|
878
|
-
var AsyncResult = class {
|
|
879
|
-
static create(actionOrPromise) {
|
|
880
|
-
return PromiseAsyncResult.create(isPromise(actionOrPromise) ? actionOrPromise : new Promise(actionOrPromise));
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Create a new {@link AsyncResult} that contains the provided value.
|
|
884
|
-
* @param value The value to wrap in a {@link AsyncResult}.
|
|
885
|
-
*/
|
|
886
|
-
static value(value) {
|
|
887
|
-
return PromiseAsyncResult.value(value);
|
|
888
|
-
}
|
|
889
|
-
/**
|
|
890
|
-
* Create a new {@link AsyncResult} that contains the provided error.
|
|
891
|
-
* @param error The error to wrap in a {@link AsyncResult}.
|
|
892
|
-
*/
|
|
893
|
-
static error(error) {
|
|
894
|
-
return PromiseAsyncResult.error(error);
|
|
895
|
-
}
|
|
896
|
-
static yield() {
|
|
897
|
-
return PromiseAsyncResult.yield();
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
// sources/byteReadStream.ts
|
|
902
|
-
var ByteReadStream = class {
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
// sources/byteWriteStream.ts
|
|
906
|
-
var ByteWriteStream = class {
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
// sources/characterReadStreamIterator.ts
|
|
910
|
-
var CharacterReadStreamAsyncIterator = class _CharacterReadStreamAsyncIterator {
|
|
911
|
-
readStream;
|
|
912
|
-
current;
|
|
913
|
-
started;
|
|
914
|
-
constructor(readStream) {
|
|
915
|
-
PreCondition.assertNotUndefinedAndNotNull(readStream, "readStream");
|
|
916
|
-
this.readStream = readStream;
|
|
917
|
-
this.current = "";
|
|
918
|
-
this.started = false;
|
|
919
|
-
}
|
|
920
|
-
static create(readStream) {
|
|
921
|
-
return new _CharacterReadStreamAsyncIterator(readStream);
|
|
922
|
-
}
|
|
923
|
-
next() {
|
|
924
|
-
return PromiseAsyncResult.create(async () => {
|
|
925
|
-
this.started = true;
|
|
926
|
-
this.current = await this.readStream.readCharacter().catch(NotFoundError, () => "");
|
|
927
|
-
return this.hasCurrent();
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
|
-
hasStarted() {
|
|
931
|
-
return this.started;
|
|
932
|
-
}
|
|
933
|
-
hasCurrent() {
|
|
934
|
-
return this.current !== "";
|
|
935
|
-
}
|
|
936
|
-
getCurrent() {
|
|
937
|
-
PreCondition.assertTrue(this.hasCurrent(), "this.hasCurrent()");
|
|
938
|
-
return this.current;
|
|
939
|
-
}
|
|
940
|
-
start() {
|
|
941
|
-
return AsyncIterator.start(this);
|
|
942
|
-
}
|
|
943
|
-
takeCurrent() {
|
|
944
|
-
return AsyncIterator.takeCurrent(this);
|
|
945
|
-
}
|
|
946
|
-
any() {
|
|
947
|
-
return AsyncIterator.any(this);
|
|
948
|
-
}
|
|
949
|
-
getCount() {
|
|
950
|
-
return AsyncIterator.getCount(this);
|
|
951
|
-
}
|
|
952
|
-
toArray() {
|
|
953
|
-
return AsyncIterator.toArray(this);
|
|
954
|
-
}
|
|
955
|
-
where(condition) {
|
|
956
|
-
return AsyncIterator.where(this, condition);
|
|
957
|
-
}
|
|
958
|
-
map(mapping) {
|
|
959
|
-
return AsyncIterator.map(this, mapping);
|
|
960
|
-
}
|
|
961
|
-
whereInstanceOf(typeCheck) {
|
|
962
|
-
return AsyncIterator.whereInstanceOf(this, typeCheck);
|
|
963
|
-
}
|
|
964
|
-
whereInstanceOfType(type) {
|
|
965
|
-
return AsyncIterator.whereInstanceOfType(this, type);
|
|
966
|
-
}
|
|
967
|
-
first(condition) {
|
|
968
|
-
return AsyncIterator.first(this, condition);
|
|
969
|
-
}
|
|
970
|
-
last(condition) {
|
|
971
|
-
return AsyncIterator.last(this, condition);
|
|
972
|
-
}
|
|
973
|
-
take(maximumToTake) {
|
|
974
|
-
return AsyncIterator.take(this, maximumToTake);
|
|
975
|
-
}
|
|
976
|
-
skip(maximumToSkip) {
|
|
977
|
-
return AsyncIterator.skip(this, maximumToSkip);
|
|
978
|
-
}
|
|
979
|
-
[Symbol.asyncIterator]() {
|
|
980
|
-
return AsyncIterator[Symbol.asyncIterator](this);
|
|
981
|
-
}
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
// sources/commandLineParameter.ts
|
|
985
|
-
var CommandLineParameter = class _CommandLineParameter {
|
|
986
|
-
/**
|
|
987
|
-
* The full name of this {@link CommandLineParameter}.
|
|
988
|
-
*/
|
|
989
|
-
name;
|
|
990
|
-
/**
|
|
991
|
-
* The description for this {@link CommandLineParameter}.
|
|
992
|
-
*/
|
|
993
|
-
description;
|
|
994
|
-
/**
|
|
995
|
-
* The function that can be invoked to get this {@link CommandLineParameter}'s value.
|
|
996
|
-
*/
|
|
997
|
-
valueGetter;
|
|
998
|
-
constructor(name, description, valueGetter) {
|
|
999
|
-
this.name = name;
|
|
1000
|
-
this.description = description;
|
|
1001
|
-
this.valueGetter = valueGetter;
|
|
1002
|
-
}
|
|
1003
|
-
/**
|
|
1004
|
-
* Create a new {@link CommandLineParameter}.
|
|
1005
|
-
* @param name The full name of the {@link CommandLineParameter}.
|
|
1006
|
-
* @param description The description for the {@link CommandLineParameter}.
|
|
1007
|
-
* @param valueGetter The function that will be used to get the returned
|
|
1008
|
-
* {@link CommandLineParameter}'s value.
|
|
1009
|
-
*/
|
|
1010
|
-
static create(name, description, valueGetter) {
|
|
1011
|
-
return new _CommandLineParameter(name, description, valueGetter);
|
|
1012
|
-
}
|
|
1013
|
-
/**
|
|
1014
|
-
* Get the value for this {@link CommandLineParameter}.
|
|
1015
|
-
*/
|
|
1016
|
-
getValue() {
|
|
1017
|
-
return this.valueGetter();
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
|
|
1021
|
-
// sources/comparable.ts
|
|
1022
|
-
var Comparable = class _Comparable {
|
|
1023
|
-
constructor() {
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Get whether this value is less than the provided value.
|
|
1027
|
-
* @param value The value to compare against.
|
|
1028
|
-
*/
|
|
1029
|
-
lessThan(value) {
|
|
1030
|
-
return _Comparable.lessThan(this, value);
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Get whether the left value is less than the right value.
|
|
1034
|
-
* @param left The left value in the comparison.
|
|
1035
|
-
* @param right The right value in the comparison.
|
|
1036
|
-
*/
|
|
1037
|
-
static lessThan(left, right) {
|
|
1038
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1039
|
-
return left.compareTo(right) === 0 /* LessThan */;
|
|
1040
|
-
}
|
|
1041
|
-
/**
|
|
1042
|
-
* Get whether this value is less than or equal to the provided value.
|
|
1043
|
-
* @param value The value to compare against.
|
|
1044
|
-
*/
|
|
1045
|
-
lessThanOrEqualTo(value) {
|
|
1046
|
-
return _Comparable.lessThanOrEqualTo(this, value);
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Get whether the left value is less than or equal to the right value.
|
|
1050
|
-
* @param left The left value in the comparison.
|
|
1051
|
-
* @param right The right value in the comparison.
|
|
1052
|
-
*/
|
|
1053
|
-
static lessThanOrEqualTo(left, right) {
|
|
1054
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1055
|
-
return left.compareTo(right) !== 2 /* GreaterThan */;
|
|
1056
|
-
}
|
|
1057
|
-
/**
|
|
1058
|
-
* Get whether this value equals the provided value.
|
|
1059
|
-
* @param value The value to compare against.
|
|
1060
|
-
*/
|
|
1061
|
-
equals(value) {
|
|
1062
|
-
return _Comparable.equals(this, value);
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* Get whether the left value equals the right value.
|
|
1066
|
-
* @param left The left value in the comparison.
|
|
1067
|
-
* @param right The right value in the comparison.
|
|
1068
|
-
*/
|
|
1069
|
-
static equals(left, right) {
|
|
1070
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1071
|
-
return left.compareTo(right) === 1 /* Equal */;
|
|
1072
|
-
}
|
|
1073
|
-
/**
|
|
1074
|
-
* Get whether this value is not equal to the provided value.
|
|
1075
|
-
* @param value The value to compare against.
|
|
1076
|
-
*/
|
|
1077
|
-
notEquals(value) {
|
|
1078
|
-
return _Comparable.notEquals(this, value);
|
|
1079
|
-
}
|
|
1080
|
-
/**
|
|
1081
|
-
* Get whether the left value is not equal to the right value.
|
|
1082
|
-
* @param left The left value in the comparison.
|
|
1083
|
-
* @param right The right value in the comparison.
|
|
1084
|
-
*/
|
|
1085
|
-
static notEquals(left, right) {
|
|
1086
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1087
|
-
return left.compareTo(right) !== 1 /* Equal */;
|
|
1088
|
-
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Get whether this value is greater than or equal to the provided value.
|
|
1091
|
-
* @param value The value to compare against.
|
|
1092
|
-
*/
|
|
1093
|
-
greaterThanOrEqualTo(value) {
|
|
1094
|
-
return _Comparable.greaterThanOrEqualTo(this, value);
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Get whether the left value is greater than or equal to the right value.
|
|
1098
|
-
* @param left The left value in the comparison.
|
|
1099
|
-
* @param right The right value in the comparison.
|
|
1100
|
-
*/
|
|
1101
|
-
static greaterThanOrEqualTo(left, right) {
|
|
1102
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1103
|
-
return left.compareTo(right) !== 0 /* LessThan */;
|
|
1104
|
-
}
|
|
1105
|
-
/**
|
|
1106
|
-
* Get whether this value is greater than the provided value.
|
|
1107
|
-
* @param value The value to compare against.
|
|
1108
|
-
*/
|
|
1109
|
-
greaterThan(value) {
|
|
1110
|
-
return _Comparable.greaterThan(this, value);
|
|
1111
|
-
}
|
|
1112
|
-
/**
|
|
1113
|
-
* Get whether the left value is greater than the right value.
|
|
1114
|
-
* @param left The left value in the comparison.
|
|
1115
|
-
* @param right The right value in the comparison.
|
|
1116
|
-
*/
|
|
1117
|
-
static greaterThan(left, right) {
|
|
1118
|
-
PreCondition.assertNotUndefinedAndNotNull(left, "left");
|
|
1119
|
-
return left.compareTo(right) === 2 /* GreaterThan */;
|
|
1120
|
-
}
|
|
1121
|
-
};
|
|
1122
|
-
|
|
1123
|
-
// sources/httpIncomingRequest.ts
|
|
1124
|
-
var HttpIncomingRequest = class {
|
|
1125
|
-
};
|
|
1126
|
-
|
|
1127
|
-
// sources/nodeJSHttpIncomingRequest.ts
|
|
1128
|
-
var NodeJSHttpIncomingRequest = class _NodeJSHttpIncomingRequest extends HttpIncomingRequest {
|
|
1129
|
-
request;
|
|
1130
|
-
constructor(request) {
|
|
1131
|
-
PreCondition.assertNotUndefinedAndNotNull(request, "request");
|
|
1132
|
-
super();
|
|
1133
|
-
this.request = request;
|
|
1134
|
-
}
|
|
1135
|
-
static create(request) {
|
|
1136
|
-
return new _NodeJSHttpIncomingRequest(request);
|
|
1137
|
-
}
|
|
1138
|
-
getMethod() {
|
|
1139
|
-
return parseHttpMethod(this.request.method).await();
|
|
1140
|
-
}
|
|
1141
|
-
getHost() {
|
|
1142
|
-
return SyncResult.value(process.env.HOST ?? "localhost");
|
|
1143
|
-
}
|
|
1144
|
-
getURLPath() {
|
|
1145
|
-
const url = new URL(this.request.url);
|
|
1146
|
-
return url.pathname;
|
|
1147
|
-
}
|
|
1148
|
-
static toHttpHeader(header) {
|
|
1149
|
-
const headerName = header[0];
|
|
1150
|
-
const headerValue = this.toHttpHeaderValue(header[1]);
|
|
1151
|
-
return HttpHeader.create(headerName, headerValue);
|
|
1152
|
-
}
|
|
1153
|
-
static toHttpHeaderValue(headerValue) {
|
|
1154
|
-
let result = headerValue;
|
|
1155
|
-
if (result === void 0) {
|
|
1156
|
-
result = "";
|
|
1157
|
-
} else if (isArray(result)) {
|
|
1158
|
-
result = result.join(",");
|
|
1159
|
-
}
|
|
1160
|
-
return result;
|
|
1161
|
-
}
|
|
1162
|
-
getHeaders() {
|
|
1163
|
-
return SyncResult.value(HttpHeaders.create(Object.entries(this.request.headers).map(_NodeJSHttpIncomingRequest.toHttpHeader)));
|
|
1164
|
-
}
|
|
1165
|
-
getHeader(headerName) {
|
|
1166
|
-
PreCondition.assertNotEmpty(headerName, "headerName");
|
|
1167
|
-
return SyncResult.create(() => {
|
|
1168
|
-
let result;
|
|
1169
|
-
const lowerHeaderName = headerName.toLowerCase();
|
|
1170
|
-
for (const header of Object.entries(this.request.headers)) {
|
|
1171
|
-
if (header[0].toLowerCase() === lowerHeaderName) {
|
|
1172
|
-
result = HttpHeader.create(header[0], _NodeJSHttpIncomingRequest.toHttpHeaderValue(header[1]));
|
|
1173
|
-
break;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
if (result === void 0) {
|
|
1177
|
-
throw new NotFoundError(`No header with the name ${escapeAndQuote(headerName)} found.`);
|
|
1178
|
-
}
|
|
1179
|
-
return result;
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
getHeaderValue(headerName) {
|
|
1183
|
-
PreCondition.assertNotEmpty(headerName, "headerName");
|
|
1184
|
-
return SyncResult.create(() => {
|
|
1185
|
-
let result;
|
|
1186
|
-
const lowerHeaderName = headerName.toLowerCase();
|
|
1187
|
-
for (const header of Object.entries(this.request.headers)) {
|
|
1188
|
-
if (header[0].toLowerCase() === lowerHeaderName) {
|
|
1189
|
-
result = _NodeJSHttpIncomingRequest.toHttpHeaderValue(header[1]);
|
|
1190
|
-
break;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
if (result === void 0) {
|
|
1194
|
-
throw new NotFoundError(`No header with the name ${escapeAndQuote(headerName)} found.`);
|
|
1195
|
-
}
|
|
1196
|
-
return result;
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1199
|
-
getBody() {
|
|
1200
|
-
return SyncResult.create(() => {
|
|
1201
|
-
throw new NotFoundError("Could not read the body from the incoming HTTP request.");
|
|
1202
|
-
});
|
|
1203
|
-
}
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
|
-
// sources/searchControl.ts
|
|
1207
|
-
var SearchControl = class {
|
|
1208
|
-
};
|
|
1209
|
-
export {
|
|
1210
|
-
AsyncIterator,
|
|
1211
|
-
AsyncIteratorToJavascriptAsyncIteratorAdapter,
|
|
1212
|
-
AsyncResult,
|
|
1213
|
-
ByteList,
|
|
1214
|
-
ByteListStream,
|
|
1215
|
-
ByteReadStream,
|
|
1216
|
-
ByteWriteStream,
|
|
1217
|
-
Bytes,
|
|
1218
|
-
CharacterList,
|
|
1219
|
-
CharacterListStream,
|
|
1220
|
-
CharacterReadStream,
|
|
1221
|
-
CharacterReadStreamAsyncIterator,
|
|
1222
|
-
CharacterWriteStream,
|
|
1223
|
-
CommandLineParameter,
|
|
1224
|
-
CommandLineParameters,
|
|
1225
|
-
Comparable,
|
|
1226
|
-
Comparer,
|
|
1227
|
-
Comparison,
|
|
1228
|
-
ConcatenateIterable,
|
|
1229
|
-
ConcatenateIterator,
|
|
1230
|
-
Condition,
|
|
1231
|
-
CurrentProcess,
|
|
1232
|
-
DateTime,
|
|
1233
|
-
Disposable,
|
|
1234
|
-
EmptyError,
|
|
1235
|
-
EqualFunctions,
|
|
1236
|
-
FetchHttpClient,
|
|
1237
|
-
FetchHttpIncomingResponse,
|
|
1238
|
-
FlatMapIterable,
|
|
1239
|
-
FlatMapIterator,
|
|
1240
|
-
Generator,
|
|
1241
|
-
HttpClient,
|
|
1242
|
-
HttpHeader,
|
|
1243
|
-
HttpHeaders,
|
|
1244
|
-
HttpIncomingRequest,
|
|
1245
|
-
HttpIncomingResponse,
|
|
1246
|
-
HttpMethod,
|
|
1247
|
-
HttpOutgoingRequest,
|
|
1248
|
-
HttpOutgoingResponse,
|
|
1249
|
-
HttpServer,
|
|
1250
|
-
InMemoryCharacterWriteStream,
|
|
1251
|
-
Iterable,
|
|
1252
|
-
Iterator,
|
|
1253
|
-
IteratorToJavascriptIteratorAdapter,
|
|
1254
|
-
JavascriptArrayList,
|
|
1255
|
-
JavascriptAsyncIteratorToAsyncIteratorAdapter,
|
|
1256
|
-
JavascriptIteratorToIteratorAdapter,
|
|
1257
|
-
JavascriptMap,
|
|
1258
|
-
JavascriptMapMap,
|
|
1259
|
-
JavascriptSet,
|
|
1260
|
-
JavascriptSetSet,
|
|
1261
|
-
List,
|
|
1262
|
-
ListQueue,
|
|
1263
|
-
ListStack,
|
|
1264
|
-
LuxonDateTime,
|
|
1265
|
-
Map,
|
|
1266
|
-
MapAsyncIterator,
|
|
1267
|
-
MapIterable,
|
|
1268
|
-
MapIterator,
|
|
1269
|
-
MutableCondition,
|
|
1270
|
-
MutableHttpHeaders,
|
|
1271
|
-
MutableMap,
|
|
1272
|
-
Network,
|
|
1273
|
-
Node,
|
|
1274
|
-
NodeJSCharacterWriteStream,
|
|
1275
|
-
NodeJSHttpIncomingRequest,
|
|
1276
|
-
NodeJSHttpServer,
|
|
1277
|
-
NotFoundError,
|
|
1278
|
-
PostCondition,
|
|
1279
|
-
PostConditionError,
|
|
1280
|
-
PreCondition,
|
|
1281
|
-
PreConditionError,
|
|
1282
|
-
PromiseAsyncResult,
|
|
1283
|
-
Property,
|
|
1284
|
-
Queue,
|
|
1285
|
-
RealNetwork,
|
|
1286
|
-
RecreationDotGovClient,
|
|
1287
|
-
RecreationDotGovDivisionAvailability,
|
|
1288
|
-
RecreationDotGovError,
|
|
1289
|
-
SearchControl,
|
|
1290
|
-
Set,
|
|
1291
|
-
SkipAsyncIterator,
|
|
1292
|
-
SkipIterator,
|
|
1293
|
-
Stack,
|
|
1294
|
-
StringComparer,
|
|
1295
|
-
StringIterator,
|
|
1296
|
-
SyncDisposable,
|
|
1297
|
-
SyncResult,
|
|
1298
|
-
TakeAsyncIterator,
|
|
1299
|
-
TakeIterator,
|
|
1300
|
-
ToStringFunctions,
|
|
1301
|
-
WhereAsyncIterator,
|
|
1302
|
-
WhereIterable,
|
|
1303
|
-
WhereIterator,
|
|
1304
|
-
WonderlandTrailAvailability,
|
|
1305
|
-
WonderlandTrailClient,
|
|
1306
|
-
WonderlandTrailConnection,
|
|
1307
|
-
WonderlandTrailConnections,
|
|
1308
|
-
WonderlandTrailDirection,
|
|
1309
|
-
WonderlandTrailItinerary,
|
|
1310
|
-
WonderlandTrailLocations,
|
|
1311
|
-
WonderlandTrailReservationType,
|
|
1312
|
-
andList,
|
|
1313
|
-
as,
|
|
1314
|
-
asArray,
|
|
1315
|
-
asBoolean,
|
|
1316
|
-
asFunction,
|
|
1317
|
-
asFunctionWithParameterCount,
|
|
1318
|
-
asNull,
|
|
1319
|
-
asNumber,
|
|
1320
|
-
asObject,
|
|
1321
|
-
asObjectOrArrayOrNull,
|
|
1322
|
-
asString,
|
|
1323
|
-
depthFirstSearch,
|
|
1324
|
-
escape,
|
|
1325
|
-
escapeAndQuote,
|
|
1326
|
-
getLength,
|
|
1327
|
-
getName,
|
|
1328
|
-
getParameterCount,
|
|
1329
|
-
getPropertyNames,
|
|
1330
|
-
hasFunction,
|
|
1331
|
-
hasProperty,
|
|
1332
|
-
httpMethodToString,
|
|
1333
|
-
instanceOf,
|
|
1334
|
-
instanceOfType,
|
|
1335
|
-
isArray,
|
|
1336
|
-
isAsyncIterable,
|
|
1337
|
-
isBoolean,
|
|
1338
|
-
isDigit,
|
|
1339
|
-
isFunction,
|
|
1340
|
-
isFunctionWithParameterCount,
|
|
1341
|
-
isIterable,
|
|
1342
|
-
isJavascriptAsyncIterable,
|
|
1343
|
-
isJavascriptAsyncIterator,
|
|
1344
|
-
isJavascriptIterable,
|
|
1345
|
-
isJavascriptIterator,
|
|
1346
|
-
isLetter,
|
|
1347
|
-
isLetterOrDigit,
|
|
1348
|
-
isLowercasedLetter,
|
|
1349
|
-
isMap,
|
|
1350
|
-
isMutableMap,
|
|
1351
|
-
isNull,
|
|
1352
|
-
isNumber,
|
|
1353
|
-
isObject,
|
|
1354
|
-
isObjectOrArrayOrNull,
|
|
1355
|
-
isPromise,
|
|
1356
|
-
isPromiseLike,
|
|
1357
|
-
isSet,
|
|
1358
|
-
isString,
|
|
1359
|
-
isUndefined,
|
|
1360
|
-
isUndefinedOrNull,
|
|
1361
|
-
isUppercasedLetter,
|
|
1362
|
-
isWhitespace,
|
|
1363
|
-
isWonderlandTrailLocation,
|
|
1364
|
-
join,
|
|
1365
|
-
orList,
|
|
1366
|
-
parseHttpMethod,
|
|
1367
|
-
quote,
|
|
1368
|
-
toString
|
|
1369
|
-
};
|
|
1370
|
-
//# sourceMappingURL=sources.js.map
|