lib/core.js
function peek(target, callback) {
		var mw = core.base();
		mw.enabled = true;
		mw.target = target;
		mw.callback = (callback || function (line /*, mw*/) {
			return line;
		});
		mw.writeln = function (line) {
			if (mw.enabled && mw.callback) {
				line = mw.callback(line, mw);
				if (typeof line === 'string') {
					mw.target.writeln(line);
				}
			}
		};
		mw.toString = function () {
			return '<miniwrite-peek>';
		};
		return mw;
	}
function peek(target, callback) {
		var mw = core.base();
		mw.enabled = true;
		mw.target = target;
		mw.callback = (callback || function (line /*, mw*/) {
			return line;
		});
		mw.writeln = function (line) {
			if (mw.enabled && mw.callback) {
				line = mw.callback(line, mw);
				if (typeof line === 'string') {
					mw.target.writeln(line);
				}
			}
		};
		mw.toString = function () {
			return '<miniwrite-peek>';
		};
		return mw;
	}
function peek ( target , callback ) { var mw = core . base ( ) ; mw . enabled = true ; mw . target = target ; mw . callback = ( callback || function ( line /*, mw*/ ) { return line ; } ) ; mw . writeln = function ( line ) { if ( mw . enabled && mw . callback ) { line = mw . callback ( line , mw ) ; if ( typeof line === 'string' ) { mw . target . writeln ( line ) ; } } } ; mw . toString = function ( ) { return '<miniwrite-peek>' ; } ; return mw ; }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - use callback to transform
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - use callback to transform