This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AsyncIterableX } from '../asynciterable'; | |
| import { AsyncSink } from '../asyncsink'; | |
| import { memoize } from './memoize'; | |
| export function bindCallback<TSource>( | |
| func: Function, | |
| selector: Function | |
| ): (...args: any[]) => AsyncIterableX<TSource> { | |
| return function(...args: any[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AsyncIterableX } from '../asynciterable'; | |
| class ConcatAsyncIterable<TSource> extends AsyncIterableX<TSource> { | |
| private _source: Iterable<AsyncIterable<TSource>>; | |
| constructor(source: Iterable<AsyncIterable<TSource>>) { | |
| super(); | |
| this._source = source; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http') | |
| const port = 3000 | |
| const requestHandler = (request, response) => { | |
| console.log(request.url) | |
| response.end('Hello Node.js Server!') | |
| } | |
| const server = http.createServer(requestHandler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { OperatorAsyncFunction } from '../interfaces'; | |
| import { AsyncIterableX } from '../asynciterable'; | |
| /* tslint:disable:max-line-length */ | |
| export function pipe<T>(source: AsyncIterable<T>): AsyncIterableX<T>; | |
| export function pipe<T, A>(source: AsyncIterable<T>, op1: OperatorAsyncFunction<T, A>): AsyncIterableX<A>; | |
| export function pipe<T, A, B>(source: AsyncIterable<T>, op1: OperatorAsyncFunction<T, A>, op2: OperatorAsyncFunction<A, B>): AsyncIterableX<B>; | |
| export function pipe<T, A, B, C>(source: AsyncIterable<T>, op1: OperatorAsyncFunction<T, A>, op2: OperatorAsyncFunction<A, B>, op3: OperatorAsyncFunction<B, C>): AsyncIterableX<C>; | |
| export function pipe<T, A, B, C, D>(source: AsyncIterable<T>, op1: OperatorAsyncFunction<T, A>, op2: OperatorAsyncFunction<A, B>, op3: OperatorAsyncFunction<B, C>, op4: OperatorAsyncFunction<C, D>): AsyncIterableX<D>; | |
| export function pipe<T, A, B, C, D, E>(source: AsyncIterable<T>, op1: OperatorAsyncFunction<T, A>, op2: OperatorAsyncFunction<A, B>, op3: OperatorAsyncFunction< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { OperatorAsyncFunction } from '../../interfaces'; | |
| import { AsyncIterableX } from '../../asynciterable'; | |
| import { BufferAsyncIterable } from '../buffer'; | |
| export function buffer<TSource>( | |
| count: number, | |
| skip?: number): OperatorAsyncFunction<TSource, TSource[]> { | |
| if (skip == null) { skip = count; } | |
| return function bufferCountOperatorFunction(source: AsyncIterable<TSource>): AsyncIterableX<TSource[]> { | |
| return new BufferAsyncIterable<TSource>(source, count, skip!); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AsyncIterableX } from '../asynciterable'; | |
| // tslint:disable-next-line:no-empty | |
| const NEVER_PROMISE = new Promise(() => { }); | |
| class MergeAsyncIterable<T> extends AsyncIterableX<T> { | |
| private _source: AsyncIterable<T>[]; | |
| constructor(source: AsyncIterable<T>[]) { | |
| super(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| import * as fs from 'fs'; | |
| import { AsyncSink, AsyncIterable } from 'ix'; | |
| AsyncIterable.from(fs | |
| .createReadStream('some.file') | |
| .pipe(new AsyncSink())) | |
| .flatMap(file => /* yes */) | |
| .forEach(/* HEAVEN */) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| import { AsyncIterableX } from '../asynciterable'; | |
| import { MonoTypeAsyncIteratorOperatorFunction } from '../interfaces'; | |
| export class AppendAsyncIterable<TSource> extends AsyncIterableX<TSource> { | |
| private _source: AsyncIterable<TSource>; | |
| private _args: TSource[]; | |
| constructor(source: AsyncIterable<TSource>, args: TSource[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| import { AsyncIterableX } from '../asynciterable'; | |
| function neverPromiseFactory<T>() { | |
| // tslint:disable-next-line:no-empty | |
| return new Promise<T>(() => { }); | |
| } | |
| class MergeAsyncIterable<T> extends AsyncIterableX<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| (set -x; brew update;) | |
| (set -x; brew upgrade;) | |
| (set -x; brew cleanup;) | |
| (set -x; brew cask cleanup;) | |
| red=`tput setaf 1` | |
| green=`tput setaf 2` | |
| reset=`tput sgr0` |