import { Writer } from '../writer'; import * as generic from './generic'; function consoleWriter(fn: (message: string) => void) { return generic.writer(function(this: Writer, value: any) { if (value !== undefined) fn(value); return this; }); } /// !doc /// ## Console EZ streams /// /// `import { consoleLog, consoleInfo, consoleWarn, consoleError } from 'f-streams'` /// * `consoleLog` /// * `consoleInfo` /// * `consoleWarn` /// * `consoleError` /// Console writers export const log: Writer = consoleWriter(console.log); export const info: Writer = consoleWriter(console.info); export const warn: Writer = consoleWriter(console.warn); export const error: Writer = consoleWriter(console.error);