chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
7 lines (5 loc) • 14.3 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a5ccf17c-7518-5981-aae8-ab46872555cd")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`);let t=require(`fs`);var n=e.t(((e,t)=>{t.exports={name:`@discoveryjs/json-ext`,version:`0.5.7`,description:`A set of utilities that extend the use of JSON`,keywords:[`json`,`utils`,`stream`,`async`,`promise`,`stringify`,`info`],author:`Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)`,license:`MIT`,repository:`discoveryjs/json-ext`,main:`./src/index`,browser:{"./src/stringify-stream.js":`./src/stringify-stream-browser.js`,"./src/text-decoder.js":`./src/text-decoder-browser.js`,"./src/version.js":`./dist/version.js`},types:`./index.d.ts`,scripts:{test:`mocha --reporter progress`,lint:`eslint src test`,"lint-and-test":`npm run lint && npm test`,build:`rollup --config`,"test:all":`npm run test:src && npm run test:dist`,"test:src":`npm test`,"test:dist":`cross-env MODE=dist npm test && cross-env MODE=dist-min npm test`,"build-and-test":`npm run build && npm run test:dist`,coverage:`c8 --reporter=lcovonly npm test`,prepublishOnly:`npm run lint && npm test && npm run build-and-test`},devDependencies:{"@rollup/plugin-commonjs":`^15.1.0`,"@rollup/plugin-json":`^4.1.0`,"@rollup/plugin-node-resolve":`^9.0.0`,c8:`^7.10.0`,chalk:`^4.1.0`,"cross-env":`^7.0.3`,eslint:`^8.10.0`,mocha:`^8.4.0`,rollup:`^2.28.2`,"rollup-plugin-terser":`^7.0.2`},engines:{node:`>=10.0.0`},files:[`dist`,`src`,`index.d.ts`]}})),r=e.t(((e,t)=>{t.exports=n().version})),i=e.t(((e,t)=>{let n={8:`\\b`,9:`\\t`,10:`\\n`,12:`\\f`,13:`\\r`,34:`\\"`,92:`\\\\`};function r(e){return e>=55296&&e<=56319}function i(e){return e>=56320&&e<=57343}function a(e){return typeof e.pipe==`function`&&typeof e._read==`function`&&typeof e._readableState==`object`&&e._readableState!==null}function o(e,t,n,r){switch(n&&typeof n.toJSON==`function`&&(n=n.toJSON()),r!==null&&(n=r.call(e,String(t),n)),typeof n){case`function`:case`symbol`:n=void 0;break;case`object`:if(n!==null){let e=n.constructor;(e===String||e===Number||e===Boolean)&&(n=n.valueOf())}break}return n}function s(e){return typeof e!=`object`||!e?1:Array.isArray(e)?3:2}function c(e){return typeof e!=`object`||!e?1:typeof e.then==`function`?4:a(e)?e._readableState.objectMode?6:5:Array.isArray(e)?3:2}function l(e){return typeof e==`function`?e:Array.isArray(e)?[...new Set(e.map(e=>{let t=e&&e.constructor;return t===String||t===Number?String(e):null}).filter(e=>typeof e==`string`))]:null}function u(e){return typeof e==`number`?!Number.isFinite(e)||e<1?!1:` `.repeat(Math.min(e,10)):typeof e==`string`&&e.slice(0,10)||!1}t.exports={escapableCharCodeSubstitution:n,isLeadingSurrogate:r,isTrailingSurrogate:i,type:{PRIMITIVE:1,PROMISE:4,ARRAY:3,OBJECT:2,STRING_STREAM:5,OBJECT_STREAM:6},isReadableStream:a,replaceValue:o,getTypeNative:s,getTypeAsync:c,normalizeReplacer:l,normalizeSpace:u}})),a=e.t(((e,t)=>{let{normalizeReplacer:n,normalizeSpace:r,replaceValue:a,getTypeNative:o,getTypeAsync:s,isLeadingSurrogate:c,isTrailingSurrogate:l,escapableCharCodeSubstitution:u,type:{PRIMITIVE:d,OBJECT:f,ARRAY:p,PROMISE:m,STRING_STREAM:h,OBJECT_STREAM:g}}=i(),_=Array.from({length:2048}).map((e,t)=>u.hasOwnProperty(t)?2:t<32?6:t<128?1:2);function v(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i<2048)t+=_[i];else if(c(i)){t+=6,n=!0;continue}else l(i)?t=n?t-2:t+6:t+=3;n=!1}return t+2}function y(e){switch(typeof e){case`string`:return v(e);case`number`:return Number.isFinite(e)?String(e).length:4;case`boolean`:return e?4:5;case`undefined`:case`object`:return 4;default:return 0}}function b(e){return e=r(e),typeof e==`string`?e.length:0}t.exports=function(e,t,r,i){function c(e,n,o){if(E)return;o=a(e,n,o,t);let s=w(o);if(s!==d&&_.has(o)){S.add(o),D+=4,i.continueOnCircular||(E=!0);return}switch(s){case d:o!==void 0||Array.isArray(e)?D+=y(o):e===T&&(D+=9);break;case f:{if(u.has(o)){x.add(o),D+=u.get(o);break}let e=D,t=0;D+=2,_.add(o);for(let e in o)if(hasOwnProperty.call(o,e)&&(l===null||l.has(e))){let n=D;c(o,e,o[e]),n!==D&&(D+=v(e)+1,t++)}t>1&&(D+=t-1),_.delete(o),r>0&&t>0&&(D+=(1+(_.size+1)*r+1)*t,D+=1+_.size*r),u.set(o,D-e);break}case p:{if(u.has(o)){x.add(o),D+=u.get(o);break}let e=D;D+=2,_.add(o);for(let e=0;e<o.length;e++)c(o,e,o[e]);o.length>1&&(D+=o.length-1),_.delete(o),r>0&&o.length>0&&(D+=(1+(_.size+1)*r)*o.length,D+=1+_.size*r),u.set(o,D-e);break}case m:case h:C.add(o);break;case g:D+=2,C.add(o);break}}let l=null;t=n(t),Array.isArray(t)&&(l=new Set(t),t=null),r=b(r),i||={};let u=new Map,_=new Set,x=new Set,S=new Set,C=new Set,w=i.async?s:o,T={"":e},E=!1,D=0;return c(T,``,e),{minLength:isNaN(D)?1/0:D,circular:[...S],duplicate:[...x],async:[...C]}}})),o=e.t(((e,t)=>{let{Readable:n}=require(`stream`),{normalizeReplacer:r,normalizeSpace:a,replaceValue:o,getTypeAsync:s,type:{PRIMITIVE:c,OBJECT:l,ARRAY:u,PROMISE:d,STRING_STREAM:f,OBJECT_STREAM:p}}=i(),m=()=>{},h=Object.prototype.hasOwnProperty,g=JSON.stringify(`\ud800`)===`"\\ud800"`?JSON.stringify:e=>JSON.stringify(e).replace(/\p{Surrogate}/gu,e=>`\\u${e.charCodeAt(0).toString(16)}`);function _(){this.push(this._stack.value),this.popStack()}function v(e){switch(typeof e){case`string`:this.push(this.encodeString(e));break;case`number`:this.push(Number.isFinite(e)?this.encodeNumber(e):`null`);break;case`boolean`:this.push(e?`true`:`false`);break;case`undefined`:case`object`:this.push(`null`);break;default:this.destroy(TypeError(`Do not know how to serialize a ${e.constructor&&e.constructor.name||typeof e}`))}}function y(e){let t=this._stack;t.first?this.push(`,`):t.first=!0,this.space?this.push(`\n${this.space.repeat(this._depth)}${this.encodeString(e)}: `):this.push(this.encodeString(e)+`:`)}function b(){let e=this._stack;if(e.index===e.keys.length){this.space&&e.first?this.push(`\n${this.space.repeat(this._depth-1)}}`):this.push(`}`),this.popStack();return}let t=e.keys[e.index];this.processValue(e.value,t,e.value[t],y),e.index++}function x(e){e!==0&&this.push(`,`),this.space&&this.push(`\n${this.space.repeat(this._depth)}`)}function S(){let e=this._stack;if(e.index===e.value.length){this.space&&e.index>0?this.push(`\n${this.space.repeat(this._depth-1)}]`):this.push(`]`),this.popStack();return}this.processValue(e.value,e.index,e.value[e.index],x),e.index++}function C(e){return function(){let t=this._stack,n=t.value.read(this._readSize);n===null?t.first&&!t.value._readableState.reading||t.ended?this.popStack():(t.first=!0,t.awaiting=!0):(t.first=!1,e.call(this,n,t))}}let w=C(function(e,t){this.processValue(t.value,t.index,e,x),t.index++}),T=C(function(e){this.push(e)});var E=class extends n{constructor(e,t,n){if(super({autoDestroy:!0}),this.getKeys=Object.keys,this.replacer=r(t),Array.isArray(this.replacer)){let e=this.replacer;this.getKeys=t=>e.filter(e=>h.call(t,e)),this.replacer=null}this.space=a(n),this._depth=0,this.error=null,this._processing=!1,this._ended=!1,this._readSize=0,this._buffer=``,this._stack=null,this._visited=new WeakSet,this.pushStack({handler:()=>{this.popStack(),this.processValue({"":e},``,e,m)}})}encodeString(e){return/[^\x20-\uD799]|[\x22\x5c]/.test(e)?g(e):`"`+e+`"`}encodeNumber(e){return e}processValue(e,t,n,r){n=o(e,t,n,this.replacer);let i=s(n);switch(i){case c:(r!==y||n!==void 0)&&(r.call(this,t),v.call(this,n));break;case l:if(r.call(this,t),this._visited.has(n))return this.destroy(TypeError(`Converting circular structure to JSON`));this._visited.add(n),this._depth++,this.push(`{`),this.pushStack({handler:b,value:n,index:0,first:!1,keys:this.getKeys(n)});break;case u:if(r.call(this,t),this._visited.has(n))return this.destroy(TypeError(`Converting circular structure to JSON`));this._visited.add(n),this.push(`[`),this.pushStack({handler:S,value:n,index:0}),this._depth++;break;case d:this.pushStack({handler:m,awaiting:!0}),Promise.resolve(n).then(n=>{this.popStack(),this.processValue(e,t,n,r),this.processStack()}).catch(e=>{this.destroy(e)});break;case f:case p:if(r.call(this,t),n.readableEnded||n._readableState.endEmitted)return this.destroy(Error(`Readable Stream has ended before it was serialized. All stream data have been lost`));if(n.readableFlowing)return this.destroy(Error(`Readable Stream is in flowing mode, data may have been lost. Trying to pause stream.`));i===p&&(this.push(`[`),this.pushStack({handler:_,value:this.space?`
`+this.space.repeat(this._depth)+`]`:`]`}),this._depth++);let a=this.pushStack({handler:i===p?w:T,value:n,index:0,first:!1,ended:!1,awaiting:!n.readable||n.readableLength===0}),o=()=>{a.awaiting&&(a.awaiting=!1,this.processStack())};n.once(`error`,e=>this.destroy(e)),n.once(`end`,()=>{a.ended=!0,o()}),n.on(`readable`,o);break}}pushStack(e){return e.prev=this._stack,this._stack=e}popStack(){let{handler:e,value:t}=this._stack;(e===b||e===S||e===w)&&(this._visited.delete(t),this._depth--),this._stack=this._stack.prev}processStack(){if(!(this._processing||this._ended)){try{for(this._processing=!0;this._stack!==null&&!this._stack.awaiting;)if(this._stack.handler.call(this),!this._processing)return;this._processing=!1}catch(e){this.destroy(e);return}this._stack===null&&!this._ended&&(this._finish(),this.push(null))}}push(e){if(e!==null){if(this._buffer+=e,this._buffer.length<this._readSize)return;e=this._buffer,this._buffer=``,this._processing=!1}super.push(e)}_read(e){this._readSize=e||this.readableHighWaterMark,this.processStack()}_finish(){this._ended=!0,this._processing=!1,this._stack=null,this._visited=null,this._buffer&&this._buffer.length&&super.push(this._buffer),this._buffer=``}_destroy(e,t){this.error=this.error||e,this._finish(),t(e)}};t.exports=function(e,t,n){return new E(e,t,n)}})),s=e.t(((e,t)=>{t.exports=require(`util`).TextDecoder})),c=e.t(((e,t)=>{let{isReadableStream:n}=i(),r=new(s());function a(e){return typeof e==`object`&&!!e}function o(e,t){return e.name===`SyntaxError`&&t.jsonParseOffset&&(e.message=e.message.replace(/at position (\d+)/,(e,n)=>`at position `+(Number(n)+t.jsonParseOffset))),e}function c(e,t){let n=e.length;e.length+=t.length;for(let r=0;r<t.length;r++)e[n+r]=t[r]}t.exports=function(e){let t=new l;if(a(e)&&n(e))return new Promise((n,r)=>{e.on(`data`,e=>{try{t.push(e)}catch(e){r(o(e,t)),t=null}}).on(`error`,e=>{t=null,r(e)}).on(`end`,()=>{try{n(t.finish())}catch(e){r(o(e,t))}finally{t=null}})});if(typeof e==`function`){let n=e();if(a(n)&&(Symbol.iterator in n||Symbol.asyncIterator in n))return new Promise(async(e,r)=>{try{for await(let e of n)t.push(e);e(t.finish())}catch(e){r(o(e,t))}finally{t=null}})}throw Error(`Chunk emitter should be readable stream, generator, async generator or function returning an iterable object`)};var l=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,t){this.stack[this.lastFlushDepth-1]===1?(t&&(this.jsonParseOffset--,e=`{`+e+`}`),Object.assign(this.valueStack.value,JSON.parse(e))):(t&&(this.jsonParseOffset--,e=`[`+e+`]`),c(this.valueStack.value,JSON.parse(e)))}prepareAddition(e){let{value:t}=this.valueStack;if(Array.isArray(t)?t.length!==0:Object.keys(t).length!==0){if(e[0]===`,`)return this.jsonParseOffset++,e.slice(1);if(e[0]!==`}`&&e[0]!==`]`)return this.jsonParseOffset-=3,`[[]`+e}return e}flush(e,t,n){let r=e.slice(t,n);if(this.jsonParseOffset=this.chunkOffset+t,this.pendingChunk!==null&&(r=this.pendingChunk+r,this.jsonParseOffset-=this.pendingChunk.length,this.pendingChunk=null),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?this.parseAndAppend(this.prepareAddition(r),!0):(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let e=this.flushDepth-1;e>=this.lastFlushDepth;e--)r+=this.stack[e]===1?`}`:`]`;this.lastFlushDepth===0?(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(r),!0);for(let e=this.lastFlushDepth||1;e<this.flushDepth;e++){let t=this.valueStack.value;if(this.stack[e-1]===1){let e;for(e in t);t=t[e]}else t=t[t.length-1];this.valueStack={value:t,prev:this.valueStack}}}else{r=this.prepareAddition(r);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.jsonParseOffset--,r=(this.stack[e]===1?`{`:`[`)+r;this.parseAndAppend(r,!1);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!=`string`){if(this.pendingByteSeq!==null){let t=e;e=new Uint8Array(this.pendingByteSeq.length+t.length),e.set(this.pendingByteSeq),e.set(t,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let t=0;t<e.length;t++){let n=e[e.length-1-t];if(n>>6==3){t++,(t!==4&&n>>3==30||t!==3&&n>>4==14||t!==2&&n>>5==6)&&(this.pendingByteSeq=e.slice(e.length-t),e=e.slice(0,-t));break}}e=r.decode(e)}let t=e.length,n=0,i=0;scan:for(let r=0;r<t;r++){if(this.stateString){for(;r<t;r++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(r)){case 34:this.stateString=!1;continue scan;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(r)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:i=r;break;case 123:i=r+1,this.stack[this.flushDepth++]=1;break;case 91:i=r+1,this.stack[this.flushDepth++]=2;break;case 93:case 125:i=r+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,n,i),n=i);break;case 9:case 10:case 13:case 32:n===r&&n++,i===r&&i++;break}}i>n&&this.flush(e,n,i),i<t&&(this.pendingChunk===null?this.pendingChunk=e.slice(i,t):this.pendingChunk+=e),this.chunkOffset+=t}finish(){return this.pendingChunk!==null&&(this.flush(``,0,0),this.pendingChunk=null),this.value}}})),l=e.t(((e,t)=>{t.exports={version:r(),stringifyInfo:a(),stringifyStream:o(),parseChunked:c()}}))();const u=async e=>(0,l.parseChunked)((0,t.createReadStream)(e));Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
//# sourceMappingURL=readStatsFile-BZQOIcua.cjs.map
//# debugId=a5ccf17c-7518-5981-aae8-ab46872555cd