'use strict';varassert=require('assert');varstream=require('stream');varhash=require('../index');describe('replacer option',function(){it('should emit information about an object to a stream',function(){varstrm=newstream.PassThrough();varreplacer=function(value){try{returnJSON.stringify(value);}catch(e){returnvalue;}};varobj={foo:'bar'};hash.writeToStream(obj,{replacer:replacer},strm);varresult=strm.read().toString();assert.strictEqual(typeofresult,'string');assert.notStrictEqual(result.indexOf(JSON.stringify(obj)),-1);});it('should not reach property values when excludeValues = true',function(){varstrm=newstream.PassThrough();varreplacer=function(k){assert.notStrictEqual(k,'bar');returnk;};hash.writeToStream({foo:'bar'},{excludeValues:true},strm);});});