!function(e){if("object"==typeofexports)module.exports=e();elseif("function"==typeofdefine&&define.amd)define(e);else{vart;"undefined"!=typeofwindow?t=window:"undefined"!=typeofglobal?t=global:"undefined"!=typeofself&&(t=self),t.objectHash=e()}}(function(){returnfunctiono(i,u,a){functions(n,e){if(!u[n]){if(!i[n]){vart="function"==typeofrequire&&require;if(!e&&t)returnt(n,!0);if(f)returnf(n,!0);thrownewError("Cannot find module '"+n+"'")}varr=u[n]={exports:{}};i[n][0].call(r.exports,function(e){vart=i[n][1][e];returns(t||e)},r,r.exports,o,i,u,a)}returnu[n].exports}for(varf="function"==typeofrequire&&require,e=0;e<a.length;e++)s(a[e]);returns}({1:[function(w,b,m){(function(e,t,f,n,r,o,i,u,a){"use strict";vars=w("crypto");functionc(e,t){returnfunction(e,t){varn;n="passthrough"!==t.algorithm?s.createHash(t.algorithm):newy;void0===n.write&&(n.write=n.update,n.end=n.update);g(t,n).dispatch(e),n.update||n.end("");if(n.digest)returnn.digest("buffer"===t.encoding?void0:t.encoding);varr=n.read();return"buffer"!==t.encoding?r.toString(t.encoding):r}(e,t=h(e,t))}(m=b.exports=c).sha1=function(e){returnc(e)},m.keys=function(e){returnc(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},m.MD5=function(e){returnc(e,{algorithm:"md5",encoding:"hex"})},m.keysMD5=function(e){returnc(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};varl=s.getHashes?s.getHashes().slice():["sha1","md5"];l.push("passthrough");vard=["buffer","hex","binary","base64"];functionh(e,t){t=t||{};varn={};if(n.algorithm=t.algorithm||"sha1",n.encoding=t.encoding||"hex",n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===t.ignoreUnknown,n.respectType=!1!==t.respectType,n.respectFunctionNames=!1!==t.respectFunctionNames,n.respectFunctionProperties=!1!==t.respectFunctionProperties,n.unorderedArrays=!0===t.unorderedArrays,n.unorderedSets=!1!==t.unorderedSets,n.unorderedObjects=!1!==t.unorderedObjects,n.replacer=t.replacer||void0,n.excludeKeys=t.excludeKeys||void0,void0===e)thrownewError("Object argument required.");for(varr=0;r<l.length;++r)l[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=l[r]);if(-1===l.indexOf(n.algorithm))thrownewError('Algorithm "'+n.algorithm+'" not supported. supported values: '+l.join(", "));if(-1===d.indexOf(n.encoding)&&"passthrough"!==n.algorithm)thrownewError('Encoding "'+n.encoding+'" not supported. supported values: '+d.join(", "));returnn}functionp(e){if("function"==typeofe){returnnull!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}}functiong(u,t,a){a=a||[];functions(e){returnt.update?t.update(e,"utf8"):t.write(e,"utf8")}return{dispatch:function(e){u.replacer&&(e=u.replacer(e));vart=typeofe;returnnull===e&&(t="null"),this["_"+t](e)},_object:function(t){vare=Object.prototype.toString.call(t),n=/\[object (.*)\]/i.exec(e);n=(n=n?n[1]:"unknown:["+e+"]").toLowerCase();varr;if(0<=(r=a.indexOf(t)))returnthis.dispatch("[CIRCULAR:"+r+"]");if(a.push(t),void0!==f&&f.isBuffer&&f.isBuffer(t))returns("buffer:"),s(t);if("object"===n||"function"===n||"asyncfunction"===n){varo=Object.keys(t);u.unorderedObjects&&(o=o.sort()),!1===u.respectType||p(t)||o.splice(0,0,"prototype","__proto__","constructor"),u.excludeKeys&&(o=o.filter(function(e){return!u.excludeKeys(e)})),s("object:"+o.length+":");vari=this;returno.forEach(function(e){i.dispatch(e),s(":"),u.excludeValues||i.dispatch(t[e]),s(",")})}if(!this["_"+n]){if(u.ignoreUnknown)returns("["+n+"]");thrownewError('Unknown object type "'+n+'"')}this["_"+n](t)},_array:function(e,t){t=void0!==t?t:!1!==u.unorderedArrays;varn=this;if(s("array:"+e.length+":"),!t||e.length<=1)returne.forEach(function(e){returnn.dispatch(e)});varr=[],o=e.map(function(e){vart=newy,n=a.slice();returng(u,t,n).dispatch(e),r=r.concat(n.slice(a.length)),t.read().toString()});returna=a.concat(r),o.sort(),this._array(o,!1)},_date:function(e){returns("date:"+e.toJSON())},_symbol:function(e){returns("symbol:"+e.toString())},_error:function(e){returns("error:"+e.toString())},_boolean:function(e){returns("bool:"+e.toString())},_string:function(e){s("string:"+e.length+":"),s(e.toString())},_function:function(e){s("fn:"),p(e)?this.dispatch("[native]"):this.dispatch(e.toString()),!1!==u.respectFunctionNames&&this.dispatch("function-name:"+String(e.name)),u.respectFunctionProperties&&this._object(e)},_number:function(e){returns("number:"+e.toString())},_xml:function(e){returns("xml:"+e.toString())},_null:function(){returns("Null")},_undefined:function(){returns("Undefined")},_regexp:function(e){returns("regex:"+e.toString())},_uint8array:function(e){returns("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){returns("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){returns("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){returns("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){returns("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){returns("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){returns("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){returns("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){returns("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){returns("arraybuffer:"),this.dispatch(newUint8Array(e))},_url:function(e){returns("url:"+e.toString())},_map:function(e){s("map:");vart=Array.from(e);returnthis._array(t,!1!==u.unorderedSets)},_set:function(e){s("set:");vart=Array.from(e);returnthis._array(t,!1!==u.unorderedSets)},_blob:function(){if(u.ignoreUnknown)returns("[blob]");throwError('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){returns("domwindow")},_process:function(){returns("process")},_timer:function(){returns("timer")},_pipe:function(){returns("pipe")},_tcp:function(){returns("tcp")},_udp:function(){returns("udp")},_tty:function(){returns("tty")},_statwatcher:function(){returns("statwatcher")},_securecontext:function(){returns("securecontext")},_connection:function(){returns("connection")},_zlib:function(){returns("zlib")},_context:function(){returns("context")},_nodescript:function(){returns("nodescript")},_httpparser:function(){returns("httpparser")},_dataview:function(){returns("dataview")},_signal:function(){returns("signal")},_fsevent:function(){returns("fsevent")},_tlswrap:function(){returns("tlswrap")}}}functiony(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){returnthis.buf}}}m.writeToStream=function(e,t,n){returnvoid0===n&&(n=t,t={}),g(t=h(e,t),n).dispatch(e)}}).call(this,w("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_794fcf4d.js","/")},{buffer:3,crypto:5,lYpoI2:10}],2:[function(e,t,f){(function(e,t,n,r,o,i,u,a,s){!function(e){"use strict";varf="undefined"!=typeofUint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),u="A".charCodeAt(0),a="-".charCodeAt(0),s="_".charCodeAt(0);functionc(e){vart=e.charCodeAt(0);returnt===n||t===a?62:t===r||t===s?63:t<o?-1:t<o+10?t-o+26+26:t<u+26?t-u:t<i+26?t-i+26:void0}e.toByteArray=function(e){vart,n,r,o,i;if(0<e.length%4)thrownewError("Invalid string. Length must be a multiple of 4");varu=e.length;o="="===e.charAt(u-2)?2:"="===e.charAt(u-1)?1:0,i=newf(3*e.length/4-o),n=0<o?e.length-4:e.length;vara=0;functions(e){i[a++]=e}for(t=0;t<n;t+=4,0)s((16711680&(r=c(e.charAt(t))<<18|c(e.charAt(t+1))<<12|c(e.charAt(t+2))<<6|c(e.charAt(t+3))))>>16),s((65280&r)>>8),s(255&r);return2==o?s(255&(r=c(e.charAt(t))<<2|c(e.charAt(t+1))>>4)):1==o&&(s((r=c(e.charAt(t))<<10|c(e.charAt(t+1))<<4|c(e.charAt(t+2))>>2)>>8&255),s(255&r)),i},e.fromByteArray=function(e){vart,n,r,o,i=e.length%3,u="";functiona(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t<r;t+=3)n=(e[t]<<16)+(e[t+1]<<8)+e[t+2],u+=a((o=n)>>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case1:u+=a((n=e[e.length-1])>>2),u+=a(n<<4&63),u+="==";break;case2:u+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10),u+=a(n>>4&63),u+=a(n<<2&63),u+="="}returnu}}(void0===f?this.base64js={}:f)}).call(this,e("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:10}],3:[function(O,e,H){(function(e,t,h,n,r,o,i,u,a){vars=O("base64-js"),f=O("ieee754");functionh(e,t,n){if(!(thisinstanceofh))returnnewh(e,t,n);varr,o,i,u,a,s=typeofe;if("base64"===t&&"string"==s)for(e=(r=e).trim?r.trim():r.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)o=x(e);elseif("string"==s)o=h.byteLength(e,t);else{if("object"!=s)thrownewError("First argument needs to be a number, array or string.");o=x(e.length)}if(h._useTypedArrays?i=h._augment(newUint8Array(o)):((i=this).length=o,i._isBuffer=!0),h._useTypedArrays&&"number"==typeofe.byteLength)i._set(e);elseif(S(a=e)||h.isBuffer(a)||a&&"object"==typeofa&&"number"==typeofa.length)for(u=0;u<o;u++)h.isBuffer(e)?i[u]=e.readUInt8(u):i[u]=e[u];elseif("string"==s)i.write(e,0,t);elseif("number"==s&&!h._useTypedArrays&&!n)for(u=0;u<o;u++)i[u]=0;returni}functionp(e,t,n,r){returnh._charsWritten=T(function(e){for(vart=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));returnt}(t),e,n,r)}functiong(e,t,n,r){returnh._charsWritten=T(function(e){for(vart,n,r,o=[],i=0;i<e.length;i++)t=e.charCodeAt(i),n=t>>8,r=t%256,o.push(r),o.push(n);returno}(t),e,n,r)}functionc(e,t,n){varr="";n=Math.min(e.length,n);for(varo=t;o<n;o++)r+=String.fromCharCode(e[o]);returnr}functionl(e,t,n,r){r||(D("boolean"==typeofn,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+1<e.length,"Trying to read beyond buffer length"));varo,i=e.length;if(!(i<=t))returnn?(o=e[t],t+1<i&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<i&&(o|=e[t+1])),o}functiond(e,t,n,r){r||(D("boolean"==typeofn,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+3<e.length,"Trying to read beyond buffer length"));varo,i=e.length;if(!(i<=t))returnn?(t+2<i&&(o=e[t+2]<<16),t+1<i&&(o|=e[t+1]<<8),o|=e[t],t+3<i&&(o+=e[t+3]<<24>>>0)):(t+1<i&&(o=e[t+1]<<16),t+2<i&&(o|=e[t+2]<<8),t+3<i&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}functiony(e,t,n,r){if(r||(D("boolean"==typeofn,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){varo=l(e,t,n,!0);return32768&o?-1*(65535-o+1):o}}functionw(e,t,n,r){if(r||(D("boolean"==typeofn,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t)){varo=d(e,t,n,!0);return2147483648&o?-1*(4294967295-o+1):o}}functionb(e,t,n,r){returnr||(D("boolean"==typeofn,"missing or invalid endian"),D(t+3<e.length,"Trying to read beyond buffer length")),f.read(e,t,n,23,4)}functionm(e,t,n,r){returnr||(D("boolean"==typeofn,"missing or invalid endian"),D(t+7<e.length,"Trying to read beyond buffer length")),f.read(e,t,n,52,8)}functionv(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+1<e.length,"trying to write beyond buffer length"),N(t,65535));vari=e.length;if(!(i<=n))for(varu=0,a=Math.min(i-n,2);u<a;u++)e[n+u]=(t&255<<8*(r?u:1-u))>>>8*(r?u:1-u)}function_(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+3<e.length,"trying to write beyond buffer length"),N(t,4294967295));vari=e.length;if(!(i<=n))for(varu=0,a=Math.min(i-n,4);u<a;u++)e[n+u]=t>>>8*(r?u:3-u)&255}functionE(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+1<e.length,"Trying to write beyond buffer length"),Y(t,32767,-32768)),e.length<=n||v(e,0<=t?t:65535+t+1,n,r,o)}functionI(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+3<e.length,"Trying to write beyond buffer length"),Y(t,2147483647,-2147483648)),e.length<=n||_(e,0<=t?t:4294967295+t+1,n,r,o)}functionA(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+3<e.length,"Trying to write beyond buffer length"),F(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||f.write(e,t,n,r,23,4)}functionB(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeofr,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+7<e.length,"Trying to write beyond buffer length"),F(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||f.write(e,t,n,r,52,8)}H.Buffer=h,H.SlowBuffer=h,H.INSPECT_MAX_BYTES=50,h.poolSize=8192,h._useTypedArrays=function(){try{vare=newArrayBuffer(0),t=newUint8Array(e);returnt.foo=function(){return42},42===t.foo()&&"function"==typeoft.subarray}catch(e){return!1}}(),h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.isBuffer=function(e){return!(null==e||!e._isBuffer)},h.byteLength=function(e,t){varn;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=C(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=k(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:thrownewError("Unknown encoding")}returnn},h.concat=function(e,t){if(D(S(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)returnnewh(0);if(1===e.length)returne[0];varn;if("number"!=typeoft)for(n=t=0;n<e.length;n++)t+=e[n].length;varr=newh(t),o=0;for(n=0;n<e.length;n++){vari=e[n];i.copy(r,o),o+=i.length}returnr},h.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void0);else{varo=r;r=t,t=n,n=o}t=Number(t)||0;vari,u,a,s,f,c,l,d=this.length-t;switch((!n||d<(n=Number(n)))&&(n=d),r=String(r||"utf8").toLowerCase()){case"hex":i=function(e,t,n,r){n=Number(n)||0;varo=e.length-n;(!r||o<(r=Number(r)))&&(r=o);vari=t.length;D(i%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(varu=0;u<r;u++){vara=parseInt(t.substr(2*u,2),16);D(!isNaN(a),"Invalid hex string"),e[n+u]=a}returnh._charsWritten=2*u,u}(this,e,t,n);break;case"utf8":case"utf-8":f=this,c=t,l=n,i=h._charsWritten=T(C(e),f,c,l);break;case"ascii":i=p(this,e,t,n);break;case"binary":i=p(this,e,t,n);break;case"base64":u=this,a=t,s=n,i=h._charsWritten=T(k(e),u,a,s);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(this,e,t,n);break;default:thrownewError("Unknown encoding")}returni},h.prototype.toString=function(e,t,n){varr,o,i,u,a=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void0!==n?Number(n):n=a.length)===t)return"";switch(e){case"hex":r=function(e,t,n){varr=e.length;(!t||t<0)&&(t=0);(!n||n<0||r<n)&&(n=r);for(varo="",i=t;i<n;i++)o+=j(e[i]);returno}(a,t,n);break;case"utf8":case"utf-8":r=function(e,t,n){varr="",o="";n=Math.min(e.length,n);for(vari=t;i<n;i++)e[i]<=127?(r+=M(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);returnr+M(o)}(a,t,n);break;case"ascii":r=c(a,t,n);break;case"binary":r=c(a,t,n);break;case"base64":o=a,u=n,r=0===(i=t)&&u===o.length?s.fromByteArray(o):s.fromByteArray(o.slice(i,u));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(e,t,n){for(varr=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);returno}(a,t,n);break;default:thrownewError("Unknown encoding")}returnr},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t=t||0,r!==n&&0!==e.length&&0!==this.length){D(n<=r,"sourceEnd < sourceStart"),D(0<=t&&t<e.length,"targetStart out of bounds"),D(0<=n&&n<this.length,"sourceStart out of bounds"),D(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);varo=r-n;if(o<100||!h._useTypedArrays)for(vari=0;i<o;i++)e[i+t]=this[i+n];elsee._set(this.subarray(n,n+o),t)}},h.prototype.slice=function(e,t){varn=this.length;if(e=U(e,n,0),t=U(t,n,n),h._useTypedArrays)returnh._augment(this.subarray(e,t));for(varr=t-e,o=newh(r,void0,!0),i=0;i<r;i++)o[i]=this[i+e];returno},h.prototype.get=function(e){returnconsole.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},h.prototype.set=function(e,t){returnconsole.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},h.prototype.readUInt8=function(e,t){if(t||(D(null!=e,"missing offset"),D(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))returnthis[e]},h.prototype.readUInt16LE=function(e,t){returnl(this,e,!0,t)},h.prototype.readUInt16BE=function(e,t){returnl(this,e,!1,t)},h.prototype.readUInt32LE=function(e,t){returnd(this,e,!0,t)},h.prototype.readUInt32BE=function(e,t){returnd(this,e,!1,t)},h.prototype.readInt8=function(e,t){if(t||(D(null!=e,"missing offset"),D(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){returny(this,e,!0,t)},h.prototype.readInt16BE=function(e,t){returny(this,e,!1,t)},h.prototype.readInt32LE=function(e,t){returnw(this,e,!0,t)},h.prototype.readInt32BE=function(e,t){returnw(this,e,!1,t)},h.prototype.readFloatLE=function(e,t){returnb(this,e,!0,t)},h.prototype.readFloatBE=function(e,t){returnb(this,e,!1,t)},h.prototype.readDoubleLE=function(e,t){returnm(this,e,!0,t)},h.prototype.readDoubleBE=function(e,t){returnm(this,e,!1,t)},h.prototype.writeUInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t<this.length,"trying to write beyond buffer length"),N(e,255)),t>=this.length||(this[t]=e)},h.prototype.writeUInt16LE=function(e,t,n){v(this,e,t,!0,n)},h.prototype.writeUInt16BE=function(e,t,n){v(this,e,t,!1,n)},h.prototype.writeUInt32LE=function(e,t,n){_(this,e,t,!0,n)},h.prototype.writeUInt32BE=function(e,t,n){_(this,e,t,!1,n)},h.prototype.writeInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t<this.length,"Trying to write beyond buffer length"),Y(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},h.prototype.writeInt16LE=function(e,t,n){E(this,e,t,!0,n)},h.prototype.writeInt16BE=function(e,t,n){E(this,e,t,!1,n)},h.prototype.writeInt32LE=function(e,t,n){I(this,e,t,!0,n)},h.prototype.writeInt32BE=function(e,t,n){I(this,e,t,!1,n)},h.prototype.writeFloatLE=function(e,t,n){A(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){A(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){B(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){B(this,e,t,!1,n)},h.prototype.fill=function(e,t,n){if(e=e||0,t=t||0,n=n||this.length,"string"==typeofe&&(e=e.charCodeAt(0)),D("number"==typeofe&&!isNaN(e),"value is not a number"),D(t<=n,"end < start"),n!==t&&0!==this.length){D(0<=t&&t<this.length,"start out of bounds"),D(0<=n&&n<=this.length,"end out of bounds");for(varr=t;r<n;r++)this[r]=e}},h.prototype.inspect=function(){for(vare=[],t=this.length,n=0;n<t;n++)if(e[n]=j(this[n]),n===H.INSPECT_MAX_BYTES){e[n+1]="...";break}return"<Buffer "+e.join(" ")+">"},h.prototype.toArrayBuffer=function(){if("undefined"==typeofUint8Array)thrownewError("Buffer.toArrayBuffer not supported in this browser");if(h._useTypedArrays)returnnewh(this).buffer;for(vare=newUint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];returne.buffer};varL=h.prototype;functionU(e,t,n){return"number"!=typeofe?n:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}functionx(e){return(e=~~Math.ceil(+e))<0?0:e}functionS(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}functionj(e){returne<16?"0"+e.toString(16):e.toString(16)}functionC(e){for(vart=[],n=0;n<e.length;n++){varr=e.charCodeAt(n);if(r<=127)t.push(e.charCodeAt(n));else{varo=n;55296<=r&&r<=57343&&n++;for(vari=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),u=0;u<i.length;u++)t.push(parseInt(i[u],16))}}returnt}functionk(e){returns.toByteArray(e)}functionT(e,t,n,r){for(varo=0;o<r&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];returno}functionM(e){try{returndecodeURIComponent(e)}catch(e){returnString.fromCharCode(65533)}}functionN(e,t){D("number"==typeofe,"cannot write a non-number as a number"),D(0<=e,"specified a negative value for writing an unsigned value"),D(e<=t,"value is larger than maximum value for type"),D(Math.floor(e)===e,"value has a fractional component")}functionY(e,t,n){D("number"==typeofe,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value"),D(Math.floor(e)===e,"value has a fractional component")}functionF(e,t,n){D("number"==typeofe,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value")}functionD(e,t){if(!e)thrownewError(t||"Failed assertion")}h._augment=function(e){returne._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=L.get,e.set=L.set,e.write=L.write,e.toString=L.toString,e.toLocaleString=L.toString,e.toJSON=L.toJSON,e.copy=L.copy,e.slice=L.slice,e.readUInt8=L.readUInt8,e.readUInt16LE=L.readUInt16LE,e.readUInt16BE=L.readUInt16BE,e.readUInt32LE=L.readUInt32LE,e.readUInt32BE=L.readUInt32BE,e.readInt8=L.readInt8,e.readInt16LE=L.readInt16LE,e.readInt16BE=L.readInt16BE,e.readInt32LE=L.readInt32LE,e.readInt32BE=L.readInt32BE,e.readFloatLE=L.readFloatLE,e.readFloatBE=L.readFloatBE,e.readDoubleLE=L.readDoubleLE,e.readDoubleBE=L.readDoubleBE,e.writeUInt8=L.writeUInt8,e.writeUInt16LE=L.writeUInt16LE,e.writeUInt16BE=L.writeUInt16BE,e.writeUInt32LE=L.writeUInt32LE,e.writeUInt32BE=L.writeUInt32BE,e.writeInt8=L.writeInt8,e.writeInt16LE=L.writeInt16LE,e.writeInt16BE=L.writeInt16BE,e.writeInt32LE=L.writeInt32LE,e.writeInt32BE=L.writeInt32BE,e.writeFloatLE=L.writeFloatLE,e.writeFloatBE=L.writeFloatBE,e.writeDoubleLE=L.writeDoubleLE,e.writeDoubleBE=L.writeDoubleBE,e.fill=L.fill,e.inspect=L.inspect,e.toArrayBuffer=L.toArrayBuffer,e}}).call(this,O("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(l,d,e){(function(e,t,u,n,r,o,i,a,s){u=l("buffer").Buffer;varf=4,c=newu(f);c.fill(0);d.exports={hash:function(e,t,n,r){returnu.isBuffer(e)||(e=newu(e)),function(e,t,n){for(varr=newu(t),o=n?r.writeInt32BE:r.writeInt32LE,i=0;i<e.length;i++)o.call(r,e[i],4*i,!0);returnr}(t(function(e,t){if(e.length%f!=0){varn=e.length+(f-e.length%f);e=u.concat([e,c],n)}for(varr=[],o=t?e.readInt32BE:e.readInt32LE,i=0;i<e.length;i+=f)r.push(o.call(e,i));returnr}(e,r),8*e.length),n,r)}}}).call(this,l("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],5:[function(w,e,b){(function(e,t,a,n,r,o,i,u,s){a=w("buffer").Buffer;varf=w("./sha"),c=w("./sha256"),l=w("./rng"),d={sha1:f,sha256:c,md5:w("./md5")},h=64,p=newa(h);functiong(e,r){varo=d[e=e||"sha1"],i=[];returno||y("algorithm:",e,"is not yet supported"),{update:function(e){returna.isBuffer(e)||(e=newa(e)),i.push(e),e.length,this},digest:function(e){vart=a.concat(i),n=r?function(e,t,n){a.isBuffer(t)||(t=newa(t)),a.isBuffer(n)||(n=newa(n)),t.length>h?t=e(t):t.length<h&&(t=a.concat([t,p],h));for(varr=newa(h),o=newa(h),i=0;i<h;i++)r[i]=54^t[i],o[i]=92^t[i];varu=e(a.concat([r,n]));returne(a.concat([o,u]))}(o,r,t):o(t);returni=null,e?n.toString(e):n}}}functiony(){vare=[].slice.call(arguments).join(" ");thrownewError([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}p.fill(0),b.createHash=function(e){returng(e)},b.createHmac=function(e,t){returng(e,t)},b.randomBytes=function(e,t){if(!t||!t.call)returnnewa(l(e));try{t.call(this,void0,newa(l(e)))}catch(e){t(e)}},function(e,t){for(varnine)t(e[n],n)}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){b[e]=function(){y("sorry,",e,"is not implemented yet")}})}).call(this,w("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:10}],6:[function(w,b,e){(function(e,t,n,r,o,i,u,a,s){varf=w("./helpers");functionc(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(varn=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u<e.length;u+=16){vara=n,s=r,f=o,c=i;n=d(n,r,o,i,e[u+0],7,-680876936),i=d(i,n,r,o,e[u+1],12,-389564586),o=d(o,i,n,r,e[u+2],17,606105819),r=d(r,o,i,n,e[u+3],22,-1044525330),n=d(n,r,o,i,e[u+4],7,-176418897),i=d(i,n,r,o,e[u+5],12,1200080426),o=d(o,i,n,r,e[u+6],17,-1473231341),r=d(r,o,i,n,e[u+7],22,-45705983),n=d(n,r,o,i,e[u+8],7,1770035416),i=d(i,n,r,o,e[u+9],12,-1958414417),o=d(o,i,n,r,e[u+10],17,-42063),r=d(r,o,i,n,e[u+11],22,-1990404162),n=d(n,r,o,i,e[u+12],7,1804603682),i=d(i,n,r,o,e[u+13],12,-40341101),o=d(o,i,n,r,e[u+14],17,-1502002290),n=h(n,r=d(r,o,i,n,e[u+15],22,1236535329),o,i,e[u+1],5,-165796510),i=h(i,n,r,o,e[u+6],9,-1069501632),o=h(o,i,n,r,e[u+11],14,643717713),r=h(r,o,i,n,e[u+0],20,-373897302),n=h(n,r,o,i,e[u+5],5,-701558691),i=h(i,n,r,o,e[u+10],9,38016083),o=h(o,i,n,r,e[u+15],14,-660478335),r=h(r,o,i,n,e[u+4],20,-405537848),n=h(n,r,o,i,e[u+9],5,568446438),i=h(i,n,r,o,e[u+14],9,-1019803690),o=h(o,i,n,r,e[u+3],14,-187363961),r=h(r,o,i,n,e[u+8],20,1163531501),n=h(n,r,o,i,e[u+13],5,-1444681467),i=h(i,n,r,o,e[u+2],9,-51403784),o=h(o,i,n,r,e[u+7],14,1735328473),n=p(n,r=h(r,o,i,n,e[u+12],20,-1926607734),o,i,e[u+5],4,-378558),i=p(i,n,r,o,e[u+8],11,-2022574463),o=p(o,i,n,r,e[u+11],16,1839030562),r=p(r,o,i,n,e[u+14],23,-35309556),n=p(n,r,o,i,e[u+1],4,-1530992060),i=p(i,n,r,o,e[u+4],11,1272893353),o=p(o,i,n,r,e[u+7],16,-155497632),r=p(r,o,i,n,e[u+10],23,-1094730640),n=p(n,r,o,i,e[u+13],4,681279174),i=p(i,n,r,o,e[u+0],11,-358537222),o=p(o,i,n,r,e[u+3],16,-722521979),r=p(r,o,i,n,e[u+6],23,76029189),n=p(n,r,o,i,e[u+9],4,-640364487),i=p(i,n,r,o,e[u+12],11,-421815835),o=p(o,i,n,r,e[u+15],16,530742520),n=g(n,r=p(r,o,i,n,e[u+2],23,-995338651),o,i,e[u+0],6,-198630844),i=g(i,n,r,o,e[u+7],10,1126891415),o=g(o,i,n,r,e[u+14],15,-1416354905),r=g(r,o,i,n,e[u+5],21,-57434055),n=g(n,r,o,i,e[u+12],6,1700485571),i=g(i,n,r,o,e[u+3],10,-1894986606),o=g(o,i,n,r,e[u+10],15,-1051523),r=g(r,o,i,n,e[u+1],21,-2054922799),n=g(n,r,o,i,e[u+8],6,1873313359),i=g(i,n,r,o,e[u+15],10,-30611744),o=g(o,i,n,r,e[u+6],15,-1560198380),r=g(r,o,i,n,e[u+13],21,1309151649),n=g(n,r,o,i,e[u+4],6,-145523070),i=g(i,n,r,o,e[u+11],10,-1120210379),o=g(o,i,n,r,e[u+2],15,718787259),r=g(r,o,i,n,e[u+9],21,-343485551),n=y(n,a),r=y(r,s),o=y(o,f),i=y(i,c)}returnArray(n,r,o,i)}functionl(e,t,n,r,o,i){returny((u=y(y(t,e),y(r,i)))<<(a=o)|u>>>32-a,n);varu,a}functiond(e,t,n,r,o,i,u){returnl(t&n|~t&r,e,t,o,i,u)}functionh(e,t,n,r,o,i,u){returnl(t&r|n&~r,e,t,o,i,u)}functionp(e,t,n,r,o,i,u){returnl(t^n^r,e,t,o,i,u)}functiong(e,t,n,r,o,i,u){returnl(n^(t|~r),e,t,o,i,u)}functiony(e,t){varn=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){returnf.hash(e,c,16)}}).call(this,w("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,l,t){(function(e,t,n,r,o,i,u,a,s){varf,c;f=function(e){for(vart,n=newArray(e),r=0;r<e;r++)0==(3&r)&&(t=4294967296*Math.random()),n[r]=t>>>((3&r)<<3)&255;returnn},l.exports=c||f}).call(this,e("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:10}],8:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){varf=l("./helpers");functionc(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(varn,r=Array(80),o=1732584193,i=-271733879,u=-1732584194,a=271733878,s=-1009589776,f=0;f<e.length;f+=16){for(varc=o,l=i,d=u,h=a,p=s,g=0;g<80;g++){r[g]=g<16?e[f+g]:m(r[g-3]^r[g-8]^r[g-14]^r[g-16],1);vary=b(b(m(o,5),w(g,i,u,a)),b(b(s,r[g]),(n=g)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));s=a,a=u,u=m(i,30),i=o,o=y}o=b(o,c),i=b(i,l),u=b(u,d),a=b(a,h),s=b(s,p)}returnArray(o,i,u,a,s)}functionw(e,t,n,r){returne<20?t&n|~t&r:!(e<40)&&e<60?t&n|t&r|n&r:t^n^r}functionb(e,t){varn=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}functionm(e,t){returne<<t|e>>>32-t}d.exports=function(e){returnf.hash(e,c,20,!0)}}).call(this,l("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){functionB(e,t){varn=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}functionL(e,t){returne>>>t|e<<32-t}functionU(e,t){returne>>>t}functionf(e,t){varn,r,o,i,u,a,s,f,c,l,d,h,p,g,y,w,b,m,v=newArray(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=newArray(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),E=newArray(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(varI=0;I<e.length;I+=16){n=_[0],r=_[1],o=_[2],i=_[3],u=_[4],a=_[5],s=_[6],f=_[7];for(varA=0;A<64;A++)E[A]=A<16?e[A+I]:B(B(B((m=E[A-2],L(m,17)^L(m,19)^U(m,10)),E[A-7]),(b=E[A-15],L(b,7)^L(b,18)^U(b,3))),E[A-16]),c=B(B(B(B(f,L(w=u,6)^L(w,11)^L(w,25)),(y=u)&a^~y&s),v[A]),E[A]),l=B(L(g=n,2)^L(g,13)^L(g,22),(d=n)&(h=r)^d&(p=o)^h&p),f=s,s=a,a=u,u=B(i,c),i=o,o=r,r=n,n=B(c,l);_[0]=B(n,_[0]),_[1]=B(r,_[1]),_[2]=B(o,_[2]),_[3]=B(i,_[3]),_[4]=B(u,_[4]),_[5]=B(a,_[5]),_[6]=B(s,_[6]),_[7]=B(f,_[7])}return_}varc=l("./helpers");d.exports=function(e){returnc.hash(e,f,32,!0)}}).call(this,l("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,c,t){(function(e,t,n,r,o,i,u,a,s){functionf(){}(e=c.exports={}).nextTick=function(){vare="undefined"!=typeofwindow&&window.setImmediate,t="undefined"!=typeofwindow&&window.postMessage&&window.addEventListener;if(e)returnfunction(e){returnwindow.setImmediate(e)};if(t){varn=[];returnwindow.addEventListener("message",function(e){vart=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<n.length&&n.shift()())},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}returnfunction(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=f,e.addListener=f,e.once=f,e.off=f,e.removeListener=f,e.removeAllListeners=f,e.emit=f,e.binding=function(e){thrownewError("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){thrownewError("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:10}],11:[function(e,t,f){(function(e,t,n,r,o,i,u,a,s){f.read=function(e,t,n,r,o){vari,u,a=8*o-r-1,s=(1<<a)-1,f=s>>1,c=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-c)-1,h>>=-c,c+=a;0<c;i=256*i+e[t+l],l+=d,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=r;0<c;u=256*u+e[t+l],l+=d,c-=8);if(0===i)i=1-f;else{if(i===s)returnu?NaN:1/0*(h?-1:1);u+=Math.pow(2,r),i-=f}return(h?-1:1)*u*Math.pow(2,i-r)},f.write=function(e,t,n,r,o,i){varu,a,s,f=8*i-o-1,c=(1<<f)-1,l=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-u))<1&&(u--,s*=2),2<=(t+=1<=u+l?d/s:d*Math.pow(2,1-l))*s&&(u++,s/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*s-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[n+h]=255&a,h+=p,a/=256,o-=8);for(u=u<<o|a,f+=o;0<f;e[n+h]=255&u,h+=p,u/=256,f-=8);e[n+h-p]|=128*g}}).call(this,e("lYpoI2"),"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/ieee754/index.js","/node_modules/ieee754")},{buffer:3,lYpoI2:10}]},{},[1])(1)});
Starting with version `1.1.8` (released April 2017), new versions will consider
the exact returned hash part of the API contract, i.e. changes that will affect
hash values will be considered `semver-major`. Previous versions may violate
that expectation.
For more information, see [this discussion](https://github.com/puleos/object-hash/issues/30).
## hash(value, options);
Generate a hash from any object or type. Defaults to sha1 with hex encoding.
*`algorithm` hash algo to be used: 'sha1', 'md5'. default: sha1
* This supports the algorithms returned by `crypto.getHashes()`. Note that the default of SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired.
function_assertThisInitialized(self){if(self===void0){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returnself;}
function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
function_wrapNativeSuper(Class){var_cache=typeofMap==="function"?newMap():undefined;_wrapNativeSuper=function_wrapNativeSuper(Class){if(Class===null||!_isNativeFunction(Class))returnClass;if(typeofClass!=="function"){thrownewTypeError("Super expression must either be null or a function");}if(typeof_cache!=="undefined"){if(_cache.has(Class))return_cache.get(Class);_cache.set(Class,Wrapper);}functionWrapper(){return_construct(Class,arguments,_getPrototypeOf(this).constructor);}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return_setPrototypeOf(Wrapper,Class);};return_wrapNativeSuper(Class);}
Define a schema and call `.validate()` with the object you want to validate.
The `.validate()` function returns an array of validation errors.
```js
importSchemafrom'validate'
constuser=newSchema({
username:{
type:String,
required:true,
length:{min:3,max:32}
},
pets:[{
name:{
type:String
required:true
},
animal:{
type:String
enum:['cat','dog','cow']
}
}],
address:{
street:{
type:String,
required:true
},
city:{
type:String,
required:true
}
zip:{
type:String,
match:/^[0-9]+$/,
required:true
}
}
})
consterrors=user.validate(obj)
```
Each error has a `.path`, describing the full path of the property that failed validation, and a `.message` describing the error.
```js
errors[0].path//=> 'address.street'
errors[0].message//=> 'address.street is required.'
```
### Custom error messages
You can override the default error messages by passing an object to `Schema#message()`.
```js
constpost=newSchema({
title:{required:true}
})
post.message({
required:(path)=>`${path} can not be empty.`
})
const[error]=post.validate({})
assert(error.message='title can not be empty.')
```
It is also possible to define messages for individual properties:
```js
constpost=newSchema({
title:{
required:true,
message:'Title is required.'
}
})
```
And for individual validators:
```js
constpost=newSchema({
title:{
type:String,
required:true,
message:{
type:'Title must be a string.',
required:'Title is required.'
}
}
})
```
### Nesting
Objects and arrays can be nested as deep as you want:
```js
constevent=newSchema({
title:{
type:String,
required:true
},
participants:[{
name:String,
email:{
type:String,
required:true
},
things:[{
name:String,
amount:Number
}]
}]
})
```
Arrays can be defined implicitly, like in the above example, or explicitly:
```js
constpost=newSchema({
keywords:{
type:Array,
each:{type:String}
}
})
```
Array elements can also be defined individually:
```js
constuser=newSchema({
something:{
type:Array,
elements:[
{type:Number},
{type:String}
]
}
})
```
Nesting also works with schemas:
```js
constuser=newSchema({
name:{
type:String,
required:true
},
email:{
type:String,
required:true
}
})
constpost=newSchema({
title:{
type:String,
required:true
},
content:{
type:String,
required:true
},
author:user
})
```
If you think it should work, it probably works.
#### Naming conflicts
Validate will naively assume that a nested object where *all* property names are validators is not a nested object.
```js
constschema=newSchema({
pet:{
type:{
required:true,
type:String,
enum:['cat','dog']
}
}
});
```
In this example, the `pet.type` property will be interpreted as a `type` rule, and the validations will not work as intended. To work around this we could use the slightly more verbose `properties` rule:
```js
constschema=newSchema({
pet:{
properties:{
type:{
required:true,
type:String,
enum:['cat','dog']
}
}
}
});
```
In this case the `type` property of `pets.properties` will be interpreted as a nested property, and the validations will work as intended.
### Custom validators
Custom validators can be defined by passing an object with named validators to `.use`:
```js
consthexColor=val=>/^#[0-9a-fA-F]$/.test(val)
constcar=newSchema({
color:{
type:String,
use:{hexColor}
}
})
```
Define a custom error message for the validator:
```js
car.message({
hexColor:path=>`${path} must be a valid color.`
})
```
### Custom types
Pass a constructor to `.type` to validate against a custom type:
```js
classCar{}
constuser=newSchema({
car:{type:Car}
})
```
### Chainable API
If you want to avoid constructing large objects, you can add paths to a schema by using the chainable API:
```js
constuser=newSchema()
user
.path('username').type(String).required()
.path('address.zip').type(String).required()
```
Array elements can be defined by using `$` as a placeholder for indices:
```js
constuser=newSchema()
user.path('pets.$').type(String)
```
This is equivalent to writing
```js
constuser=newSchema({pets:[{type:String}]})
```
### Typecasting
Values can be automatically typecast before validation.
To enable typecasting, pass an options object to the `Schema` constructor with `typecast` set to `true`.
```js
constuser=newSchema(definition,{typecast:true})
```
You can override this setting by passing an option to `.validate()`.
```js
user.validate(obj,{typecast:false})
```
To typecast custom types, you can register a typecaster:
```js
classCar{}
constuser=newSchema({
car:{type:Car}
})
user.typecaster({
Car:(val)=>newCar(val)
})
```
### Property stripping
By default, all values not defined in the schema will be stripped from the object.
Set `.strip = false` on the options object to disable this behavior.
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
#### Table of Contents
-[Property](#property)
-[Parameters](#parameters)
-[message](#message)
-[Parameters](#parameters-1)
-[Examples](#examples)
-[schema](#schema)
-[Parameters](#parameters-2)
-[Examples](#examples-1)
-[use](#use)
-[Parameters](#parameters-3)
-[Examples](#examples-2)
-[required](#required)
-[Parameters](#parameters-4)
-[Examples](#examples-3)
-[type](#type)
-[Parameters](#parameters-5)
-[Examples](#examples-4)
-[string](#string)
-[Examples](#examples-5)
-[number](#number)
-[Examples](#examples-6)
-[array](#array)
-[Examples](#examples-7)
-[date](#date)
-[Examples](#examples-8)
-[length](#length)
-[Parameters](#parameters-6)
-[Examples](#examples-9)
-[size](#size)
-[Parameters](#parameters-7)
-[Examples](#examples-10)
-[enum](#enum)
-[Parameters](#parameters-8)
-[Examples](#examples-11)
-[match](#match)
-[Parameters](#parameters-9)
-[Examples](#examples-12)
-[each](#each)
-[Parameters](#parameters-10)
-[Examples](#examples-13)
-[elements](#elements)
-[Parameters](#parameters-11)
-[Examples](#examples-14)
-[properties](#properties)
-[Parameters](#parameters-12)
-[Examples](#examples-15)
-[path](#path)
-[Parameters](#parameters-13)
-[Examples](#examples-16)
-[typecast](#typecast)
-[Parameters](#parameters-14)
-[Examples](#examples-17)
-[validate](#validate)
-[Parameters](#parameters-15)
-[Examples](#examples-18)
-[Schema](#schema-1)
-[Parameters](#parameters-16)
-[Examples](#examples-19)
-[path](#path-1)
-[Parameters](#parameters-17)
-[Examples](#examples-20)
-[validate](#validate-1)
-[Parameters](#parameters-18)
-[Examples](#examples-21)
-[assert](#assert)
-[Parameters](#parameters-19)
-[Examples](#examples-22)
-[message](#message-1)
-[Parameters](#parameters-20)
-[Examples](#examples-23)
-[validator](#validator)
-[Parameters](#parameters-21)
-[Examples](#examples-24)
-[typecaster](#typecaster)
-[Parameters](#parameters-22)
-[Examples](#examples-25)
### Property
A property instance gets returned whenever you call `schema.path()`.
Properties are also created internally when an object is passed to the Schema constructor.
#### Parameters
-`name`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the property
-`schema`**[Schema](#schema)** the schema to mount
##### Examples
```javascript
constuser=newSchema({email:String})
prop.schema(user)
```
Returns **[Property](#property)**
#### use
Validate using named functions from the given object.
Error messages can be defined by providing an object with
named error messages/generators to `schema.message()`
The message generator receives the value being validated,
the object it belongs to and any additional arguments.
##### Parameters
-`fns`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object with named validation functions to call
##### Examples
```javascript
constschema=newSchema()
constprop=schema.path('some.path')
schema.message({
binary:(path,ctx)=>`${path} must be binary.`,
bits:(path,ctx,bits)=>`${path} must be ${bits}-bit`
})
prop.use({
binary:(val,ctx)=>/^[01]+$/i.test(val),
bits:[(val,ctx,bits)=>val.length==bits,32]
})
```
Returns **[Property](#property)**
#### required
Registers a validator that checks for presence.
##### Parameters
-`bool`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**`true` if required, `false` otherwise (optional, default `true`)
##### Examples
```javascript
prop.required()
```
Returns **[Property](#property)**
#### type
Registers a validator that checks if a value is of a given `type`
##### Parameters
-`type`**([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function))** type to check for
##### Examples
```javascript
prop.type(String)
```
```javascript
prop.type('string')
```
Returns **[Property](#property)**
#### string
Convenience method for setting type to `String`
##### Examples
```javascript
prop.string()
```
Returns **[Property](#property)**
#### number
Convenience method for setting type to `Number`
##### Examples
```javascript
prop.number()
```
Returns **[Property](#property)**
#### array
Convenience method for setting type to `Array`
##### Examples
```javascript
prop.array()
```
Returns **[Property](#property)**
#### date
Convenience method for setting type to `Date`
##### Examples
```javascript
prop.date()
```
Returns **[Property](#property)**
#### length
Registers a validator that checks length.
##### Parameters
-`rules`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))** object with `.min` and `.max` properties or a number
-`rules.max`**[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** maximum length
##### Examples
```javascript
prop.length({min:8,max:255})
prop.length(10)
```
Returns **[Property](#property)**
#### size
Registers a validator that checks size.
##### Parameters
-`rules`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))** object with `.min` and `.max` properties or a number
Registers a validator that checks if a value matches given `regexp`.
##### Parameters
-`regexp`**[RegExp](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp)** regular expression to match
##### Examples
```javascript
prop.match(/some\sregular\sexpression/)
```
Returns **[Property](#property)**
#### each
Registers a validator that checks each value in an array against given `rules`.
##### Parameters
-`rules`**([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [Schema](#schema) \| [Property](#property))** rules to use
##### Examples
```javascript
prop.each({type:String})
prop.each([{type:Number}])
prop.each({things:[{type:String}]})
prop.each(schema)
```
Returns **[Property](#property)**
#### elements
Registers paths for array elements on the parent schema, with given array of rules.
##### Parameters
-`arr`**[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** array of rules to use
##### Examples
```javascript
prop.elements([{type:String},{type:Number}])
```
Returns **[Property](#property)**
#### properties
Registers all properties from the given object as nested properties
##### Parameters
-`props`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** properties with rules
##### Examples
```javascript
prop.properties({
name:String,
email:String
})
```
Returns **[Property](#property)**
#### path
Proxy method for schema path. Makes chaining properties together easier.
##### Parameters
-`args`**...any**
##### Examples
```javascript
schema
.path('name').type(String).required()
.path('email').type(String).required()
```
#### typecast
Typecast given `value`
##### Parameters
-`value`**Mixed** value to typecast
##### Examples
```javascript
prop.type(String)
prop.typecast(123)// => '123'
```
Returns **Mixed**
#### validate
Validate given `value`
##### Parameters
-`value`**Mixed** value to validate
-`ctx`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** the object containing the value
-`path`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** path of the value being validated (optional, default `this.name`)
-`opts.typecast`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** typecast values before validation (optional, default `false`)
-`opts.strip`**[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** strip properties not defined in the schema (optional, default `true`)
#### Examples
```javascript
constpost=newSchema({
title:{
type:String,
required:true,
length:{min:1,max:255}
},
content:{
type:String,
required:true
},
published:{
type:Date,
required:true
},
keywords:[{type:String}]
})
```
```javascript
constauthor=newSchema({
name:{
type:String,
required:true
},
email:{
type:String,
required:true
},
posts:[post]
})
```
#### path
Create or update `path` with given `rules`.
##### Parameters
-`path`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** full path using dot-notation
-`name`**([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the validator or an object with name-message pairs
-`message`**([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function))?** the message or message generator to use
##### Examples
```javascript
consthex=(val)=>/^0x[0-9a-f]+$/.test(val)
schema.path('some.path').use({hex})
schema.message('hex',path=>`${path} must be hexadecimal`)
```
```javascript
schema.message({hex:path=>`${path} must be hexadecimal`})
```
Returns **[Schema](#schema)**
#### validator
Override default validators.
##### Parameters
-`name`**([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the validator or an object with name-function pairs
-`fn`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** the function to use
##### Examples
```javascript
schema.validator('required',val=>val!=null)
```
```javascript
schema.validator({required:val=>val!=null})
```
Returns **[Schema](#schema)**
#### typecaster
Override default typecasters.
##### Parameters
-`name`**([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the validator or an object with name-function pairs
-`fn`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** the function to use