"use strict";var __values=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],a=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(exports,"__esModule",{value:!0}),exports.sameDataDiffRef=void 0;var chai_1=require("chai"),isPrimitive_js_1=require("./isPrimitive.js"),sameDataDiffRef=function(e,t,i,a){var r,o;if(void 0!==e||void 0!==t){(0,chai_1.expect)(typeof e,"typeof ".concat(i)).to.equal(typeof t),(0,chai_1.expect)(e,i).not.to.equal(t);var n=new Set(Object.keys(e).concat(Object.keys(t)).filter((function(e){return e.indexOf("_")!==e.length-1})));Array.isArray(a)&&a.forEach((function(e){n.has(e)&&n.delete(e)}));try{for(var f=__values(n),c=f.next();!c.done;c=f.next()){var s=c.value;if(s.indexOf("_")!==s.length-1){var l=e[s],u=t[s],v=typeof l;if((0,chai_1.expect)(typeof u,"typeof ".concat(i,"->").concat(s)).to.equal(v),void 0===l&&void 0===u)continue;if((0,isPrimitive_js_1.isPrimitive)(l))(0,chai_1.expect)(u,"".concat(i,"->").concat(s)).to.equal(l);else if(l instanceof Date){var y=l.getTime(),_=u.getTime();(0,chai_1.expect)(_,"".concat(i,"->").concat(s)).to.be.within(y-100,y+100)}else(0,exports.sameDataDiffRef)(l,u,s,a)}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}}};exports.sameDataDiffRef=sameDataDiffRef;