Fix export structure

This commit is contained in:
Sami Turcotte
2018-11-25 20:24:35 -05:00
parent 2d3c1eee82
commit 0df74cb48f
8 changed files with 46 additions and 41 deletions

View File

@@ -1,27 +1,6 @@
/**
* Resolve after the given delay in milliseconds
*
* @param ms - The number of milliseconds to wait
*/
export function sleep(ms: number) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
/**
* Resolve once the given event emitter emits the specified event
*
* @param emitter - The event emitter to watch
* @param event - The event to watch
*/
export function once<T>(
emitter: NodeJS.EventEmitter,
event: string,
): Promise<T> {
return new Promise(resolve => {
emitter.once(event, result => {
resolve(result);
});
});
}
import * as utils from "./utils";
import * as stream from "./stream";
export = {
...utils,
stream,
};