1 | import { AsyncIterableX } from './asynciterablex';
|
2 | export class TimestampAsyncIterable extends AsyncIterableX {
|
3 | constructor(source) {
|
4 | super();
|
5 | this._source = source;
|
6 | }
|
7 | async *[Symbol.asyncIterator]() {
|
8 | for await (const item of this._source) {
|
9 | yield { time: Date.now(), value: item };
|
10 | }
|
11 | }
|
12 | }
|
13 | export function timestamp(source) {
|
14 | return new TimestampAsyncIterable(source);
|
15 | }
|
16 |
|
17 | //# sourceMappingURL=timestamp.mjs.map
|