Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@observablehq/inspector

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@observablehq/inspector - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

4

dist/inspector.js

@@ -1,2 +0,2 @@

// @observablehq/inspector v3.2.2 Copyright 2021 Observable, Inc.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).observablehq=e.observablehq||{})}(this,(function(e){"use strict";function t(e,t,n){n=n||{};var o=e.ownerDocument,r=o.defaultView.CustomEvent;"function"==typeof r?r=new r(t,{detail:n}):((r=o.createEvent("Event")).initEvent(t,!1,!1),r.detail=n),e.dispatchEvent(r)}function n(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function s(e){return a.call(e)}const{getOwnPropertySymbols:c,prototype:{hasOwnProperty:i}}=Object,{toStringTag:l}=Symbol,d={},u=c;function p(e,t){return i.call(e,t)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function m(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return d}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function b(e){try{let t=h.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),o="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),r=t.some((e=>e.arrayish)),a=t.some((e=>e.setish));return{name:`${o?o.name:""}${n.name}`,symbols:t,arrayish:r&&!a,setish:a}}catch(e){return null}}const{getPrototypeOf:y,getOwnPropertyDescriptors:v}=Object,C=y({});function g(e,o,a,s){let c,i,l,d,u=n(e);e instanceof Map?e instanceof e.constructor?(c=`Map(${e.size})`,i=x):(c="Map()",i=M):e instanceof Set?e instanceof e.constructor?(c=`Set(${e.size})`,i=E):(c="Set()",i=M):u?(c=`${e.constructor.name}(${e.length})`,i=N):(d=b(e))?(c=`Immutable.${d.name}${"Record"===d.name?"":`(${e.size})`}`,u=d.arrayish,i=d.arrayish?_:d.setish?q:S):s?(c=f(e),i=T):(c=f(e),i=M);const p=document.createElement("span");p.className="observablehq--expanded",a&&p.appendChild(r(a));const m=p.appendChild(document.createElement("a"));m.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",m.appendChild(document.createTextNode(`${c}${u?" [":" {"}`)),m.addEventListener("mouseup",(function(t){t.stopPropagation(),ce(p,U(e,null,a,s))})),i=i(e);for(let e=0;!(l=i.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const e=p.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",(function(e){e.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=i.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),t(p,"load")}))}return p.appendChild(document.createTextNode(u?"]":"}")),p}function*x(e){for(const[t,n]of e)yield w(t,n);yield*M(e)}function*E(e){for(const t of e)yield A(t);yield*M(e)}function*q(e){for(const t of e)yield A(t)}function*N(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield L(t,m(e,t),"observablehq--index"));for(const t in e)!o(t)&&p(e,t)&&(yield L(t,m(e,t),"observablehq--key"));for(const t of u(e))yield L(s(t),m(e,t),"observablehq--symbol")}function*_(e){let t=0;for(const n=e.size;t<n;++t)yield L(t,e.get(t),!0)}function*T(e){for(const t in v(e))yield L(t,m(e,t),"observablehq--key");for(const t of u(e))yield L(s(t),m(e,t),"observablehq--symbol");const t=y(e);t&&t!==C&&(yield $(t))}function*M(e){for(const t in e)p(e,t)&&(yield L(t,m(e,t),"observablehq--key"));for(const t of u(e))yield L(s(t),m(e,t),"observablehq--symbol");const t=y(e);t&&t!==C&&(yield $(t))}function*S(e){for(const[t,n]of e)yield L(t,n,"observablehq--key")}function $(e){const t=document.createElement("div"),n=t.appendChild(document.createElement("span"));return t.className="observablehq--field",n.className="observablehq--prototype-key",n.textContent=" <prototype>",t.appendChild(document.createTextNode(": ")),t.appendChild(se(e,void 0,void 0,void 0,!0)),t}function L(e,t,n){const o=document.createElement("div"),r=o.appendChild(document.createElement("span"));return o.className="observablehq--field",r.className=n,r.textContent=` ${e}`,o.appendChild(document.createTextNode(": ")),o.appendChild(se(t)),o}function w(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(se(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(se(t)),n}function A(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(se(e)),t}function k(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function U(e,t,o,a){let s,c,i,l,d=n(e);if(e instanceof Map?e instanceof e.constructor?(s=`Map(${e.size})`,c=I):(s="Map()",c=z):e instanceof Set?e instanceof e.constructor?(s=`Set(${e.size})`,c=D):(s="Set()",c=z):d?(s=`${e.constructor.name}(${e.length})`,c=P):(l=b(e))?(s=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,d=l.arrayish,c=l.arrayish?j:l.setish?O:B):(s=f(e),c=z),t){const t=document.createElement("span");return t.className="observablehq--shallow",o&&t.appendChild(r(o)),t.appendChild(document.createTextNode(s)),t.addEventListener("mouseup",(function(n){k(t)||(n.stopPropagation(),ce(t,U(e)))})),t}const u=document.createElement("span");u.className="observablehq--collapsed",o&&u.appendChild(r(o));const p=u.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),u.addEventListener("mouseup",(function(t){k(u)||(t.stopPropagation(),ce(u,g(e,0,o,a)))}),!0),c=c(e);for(let e=0;!(i=c.next()).done&&e<20;++e)e>0&&u.appendChild(document.createTextNode(", ")),u.appendChild(i.value);return i.done||u.appendChild(document.createTextNode(", …")),u.appendChild(document.createTextNode(d?"]":"}")),u}function*I(e){for(const[t,n]of e)yield H(t,n);yield*z(e)}function*D(e){for(const t of e)yield se(t,!0);yield*z(e)}function*O(e){for(const t of e)yield se(t,!0)}function*j(e){let t=-1,n=0;for(const o=e.size;n<o;++n)n>t+1&&(yield F(n-t-1)),yield se(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*P(e){let t=-1,n=0;for(const o=e.length;n<o;++n)n in e&&(n>t+1&&(yield F(n-t-1)),yield se(m(e,n),!0),t=n);n>t+1&&(yield F(n-t-1));for(const t in e)!o(t)&&p(e,t)&&(yield R(t,m(e,t),"observablehq--key"));for(const t of u(e))yield R(s(t),m(e,t),"observablehq--symbol")}function*z(e){for(const t in e)p(e,t)&&(yield R(t,m(e,t),"observablehq--key"));for(const t of u(e))yield R(s(t),m(e,t),"observablehq--symbol")}function*B(e){for(const[t,n]of e)yield R(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function R(e,t,n){const o=document.createDocumentFragment(),r=o.appendChild(document.createElement("span"));return r.className=n,r.textContent=e,o.appendChild(document.createTextNode(": ")),o.appendChild(se(t,!0)),o}function H(e,t){const n=document.createDocumentFragment();return n.appendChild(se(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(se(t,!0)),n}function K(e,t){var n=e+"",o=n.length;return o<t?new Array(t-o+1).join(0)+n:n}function Y(e){return e<0?"-"+K(-e,6):e>9999?"+"+K(e,6):K(e,4)}var G=Error.prototype.toString;var J=RegExp.prototype.toString;function V(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,X)}function X(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function Q(e,t){for(var n=0;t.exec(e);)++n;return n}var W=Function.prototype.toString,Z={prefix:"async ƒ"},ee={prefix:"async ƒ*"},te={prefix:"class"},ne={prefix:"ƒ"},oe={prefix:"ƒ*"};function re(e,t,n){var o=document.createElement("span");o.className="observablehq--function",n&&o.appendChild(r(n));var a=o.appendChild(document.createElement("span"));return a.className="observablehq--keyword",a.textContent=e.prefix,o.appendChild(document.createTextNode(t)),o}const{prototype:{toString:ae}}=Object;function se(e,t,n,o,a){let c=typeof e;switch(c){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=s(e);break;case"function":return function(e,t){var n,o,r=W.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=Z;break;case"AsyncGeneratorFunction":n=ee;break;case"GeneratorFunction":n=oe;break;default:n=/^class\b/.test(r)?te:ne}return n===te?re(n,"",t):(o=/^(?:async\s*)?(\w+)\s*=>/.exec(r))?re(n,"("+o[1]+")",t):(o=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))||(o=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?re(n,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,o);case"string":return function(e,t,n,o){if(!1===t){if(Q(e,/["\n]/g)<=Q(e,/`|\${/g)){const t=document.createElement("span");o&&t.appendChild(r(o));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const a=e.split("\n");if(a.length>20&&!n){const n=document.createElement("div");o&&n.appendChild(r(o));const s=n.appendChild(document.createElement("span"));s.className="observablehq--string",s.textContent="`"+V(a.slice(0,20).join("\n"));const c=n.appendChild(document.createElement("span")),i=a.length-20;return c.textContent=`Show ${i} truncated line${i>1?"s":""}`,c.className="observablehq--string-expand",c.addEventListener("mouseup",(function(r){r.stopPropagation(),ce(n,se(e,t,!0,o))})),n}const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className="observablehq--string"+(n?" observablehq--expanded":""),c.textContent="`"+V(e)+"`",s}const a=document.createElement("span");o&&a.appendChild(r(o));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string",s.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),a}(e,t,n,o);default:if(null===e){c=null,e="null";break}if(e instanceof Date){c="date",i=e,e=isNaN(i)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(i)?Y(i.getUTCFullYear())+"-"+K(i.getUTCMonth()+1,2)+"-"+K(i.getUTCDate(),2):Y(i.getFullYear())+"-"+K(i.getMonth()+1,2)+"-"+K(i.getDate(),2)+"T"+K(i.getHours(),2)+":"+K(i.getMinutes(),2)+(i.getMilliseconds()?":"+K(i.getSeconds(),2)+"."+K(i.getMilliseconds(),3):i.getSeconds()?":"+K(i.getSeconds(),2):"");break}if(e===d){c="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":c="regexp",e=function(e){return J.call(e)}(e);break;case"[object Error]":case"[object DOMException]":c="error",e=function(e){return e.stack||G.call(e)}(e);break;default:return(n?g:U)(e,t,o,a)}}var i;const l=document.createElement("span");o&&l.appendChild(r(o));const u=l.appendChild(document.createElement("span"));return u.className=`observablehq--${c}`,u.textContent=e,l}function ce(e,n){e.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),e.parentNode.replaceChild(n,e),t(n,"load")}const ie=/\s+\(\d+:\d+\)$/m;class le{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,n){const{_node:o}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==o)&&(e=se(e,!1,o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),o.classList.remove("observablehq--running","observablehq--error"),o.firstChild!==e)if(o.firstChild){for(;o.lastChild!==o.firstChild;)o.removeChild(o.lastChild);o.replaceChild(e,o.firstChild)}else o.appendChild(e);t(o,"update")}rejected(e,n){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var a=document.createElement("div");a.className="observablehq--inspect",n&&a.appendChild(r(n)),a.appendChild(document.createTextNode((e+"").replace(ie,""))),o.appendChild(a),t(o,"error",{error:e})}}le.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new le(e.appendChild(document.createElement("div")))}},e.Inspector=le,Object.defineProperty(e,"__esModule",{value:!0})}));
// @observablehq/inspector v3.2.3 Copyright 2021 Observable, Inc.
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).observablehq=e.observablehq||{})}(this,(function(e){"use strict";function n(e,n,t){t=t||{};var o=e.ownerDocument,r=o.defaultView.CustomEvent;"function"==typeof r?r=new r(n,{detail:t}):((r=o.createEvent("Event")).initEvent(n,!1,!1),r.detail=t),e.dispatchEvent(r)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return e===(0|e)+""}function r(e){const n=document.createElement("span");return n.className="observablehq--cellname",n.textContent=`${e} = `,n}const a=Symbol.prototype.toString;function s(e){return a.call(e)}const{getOwnPropertySymbols:c,prototype:{hasOwnProperty:i}}=Object,{toStringTag:l}=Symbol,d={},u=c;function p(e,n){return i.call(e,n)}function f(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function m(e,n){try{const t=e[n];return t&&t.constructor,t}catch(e){return d}}const h=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function b(e){try{let n=h.filter((({symbol:n})=>!0===e[n]));if(!n.length)return;const t=n.find((e=>!e.modifier)),o="Map"===t.name&&n.find((e=>e.modifier&&e.prefix)),r=n.some((e=>e.arrayish)),a=n.some((e=>e.setish));return{name:`${o?o.name:""}${t.name}`,symbols:n,arrayish:r&&!a,setish:a}}catch(e){return null}}const{getPrototypeOf:y,getOwnPropertyDescriptors:v}=Object,C=y({});function g(e,o,a,s){let c,i,l,d,u=t(e);e instanceof Map?e instanceof e.constructor?(c=`Map(${e.size})`,i=x):(c="Map()",i=M):e instanceof Set?e instanceof e.constructor?(c=`Set(${e.size})`,i=E):(c="Set()",i=M):u?(c=`${e.constructor.name}(${e.length})`,i=N):(d=b(e))?(c=`Immutable.${d.name}${"Record"===d.name?"":`(${e.size})`}`,u=d.arrayish,i=d.arrayish?_:d.setish?q:S):s?(c=f(e),i=T):(c=f(e),i=M);const p=document.createElement("span");p.className="observablehq--expanded",a&&p.appendChild(r(a));const m=p.appendChild(document.createElement("a"));m.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",m.appendChild(document.createTextNode(`${c}${u?" [":" {"}`)),m.addEventListener("mouseup",(function(n){n.stopPropagation(),ce(p,U(e,null,a,s))})),i=i(e);for(let e=0;!(l=i.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const e=p.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",(function(e){e.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=i.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),n(p,"load")}))}return p.appendChild(document.createTextNode(u?"]":"}")),p}function*x(e){for(const[n,t]of e)yield w(n,t);yield*M(e)}function*E(e){for(const n of e)yield A(n);yield*M(e)}function*q(e){for(const n of e)yield A(n)}function*N(e){for(let n=0,t=e.length;n<t;++n)n in e&&(yield L(n,m(e,n),"observablehq--index"));for(const n in e)!o(n)&&p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol")}function*_(e){let n=0;for(const t=e.size;n<t;++n)yield L(n,e.get(n),!0)}function*T(e){for(const n in v(e))yield L(n,m(e,n),"observablehq--key");for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*M(e){for(const n in e)p(e,n)&&(yield L(n,m(e,n),"observablehq--key"));for(const n of u(e))yield L(s(n),m(e,n),"observablehq--symbol");const n=y(e);n&&n!==C&&(yield $(n))}function*S(e){for(const[n,t]of e)yield L(n,t,"observablehq--key")}function $(e){const n=document.createElement("div"),t=n.appendChild(document.createElement("span"));return n.className="observablehq--field",t.className="observablehq--prototype-key",t.textContent=" <prototype>",n.appendChild(document.createTextNode(": ")),n.appendChild(se(e,void 0,void 0,void 0,!0)),n}function L(e,n,t){const o=document.createElement("div"),r=o.appendChild(document.createElement("span"));return o.className="observablehq--field",r.className=t,r.textContent=` ${e}`,o.appendChild(document.createTextNode(": ")),o.appendChild(se(n)),o}function w(e,n){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(se(e)),t.appendChild(document.createTextNode(" => ")),t.appendChild(se(n)),t}function A(e){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(se(e)),n}function k(e){const n=window.getSelection();return"Range"===n.type&&(n.containsNode(e,!0)||n.anchorNode.isSelfOrDescendant(e)||n.focusNode.isSelfOrDescendant(e))}function U(e,n,o,a){let s,c,i,l,d=t(e);if(e instanceof Map?e instanceof e.constructor?(s=`Map(${e.size})`,c=I):(s="Map()",c=z):e instanceof Set?e instanceof e.constructor?(s=`Set(${e.size})`,c=D):(s="Set()",c=z):d?(s=`${e.constructor.name}(${e.length})`,c=P):(l=b(e))?(s=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,d=l.arrayish,c=l.arrayish?j:l.setish?O:B):(s=f(e),c=z),n){const n=document.createElement("span");return n.className="observablehq--shallow",o&&n.appendChild(r(o)),n.appendChild(document.createTextNode(s)),n.addEventListener("mouseup",(function(t){k(n)||(t.stopPropagation(),ce(n,U(e)))})),n}const u=document.createElement("span");u.className="observablehq--collapsed",o&&u.appendChild(r(o));const p=u.appendChild(document.createElement("a"));p.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",p.appendChild(document.createTextNode(`${s}${d?" [":" {"}`)),u.addEventListener("mouseup",(function(n){k(u)||(n.stopPropagation(),ce(u,g(e,0,o,a)))}),!0),c=c(e);for(let e=0;!(i=c.next()).done&&e<20;++e)e>0&&u.appendChild(document.createTextNode(", ")),u.appendChild(i.value);return i.done||u.appendChild(document.createTextNode(", …")),u.appendChild(document.createTextNode(d?"]":"}")),u}function*I(e){for(const[n,t]of e)yield H(n,t);yield*z(e)}function*D(e){for(const n of e)yield se(n,!0);yield*z(e)}function*O(e){for(const n of e)yield se(n,!0)}function*j(e){let n=-1,t=0;for(const o=e.size;t<o;++t)t>n+1&&(yield F(t-n-1)),yield se(e.get(t),!0),n=t;t>n+1&&(yield F(t-n-1))}function*P(e){let n=-1,t=0;for(const o=e.length;t<o;++t)t in e&&(t>n+1&&(yield F(t-n-1)),yield se(m(e,t),!0),n=t);t>n+1&&(yield F(t-n-1));for(const n in e)!o(n)&&p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*z(e){for(const n in e)p(e,n)&&(yield R(n,m(e,n),"observablehq--key"));for(const n of u(e))yield R(s(n),m(e,n),"observablehq--symbol")}function*B(e){for(const[n,t]of e)yield R(n,t,"observablehq--key")}function F(e){const n=document.createElement("span");return n.className="observablehq--empty",n.textContent=1===e?"empty":`empty × ${e}`,n}function R(e,n,t){const o=document.createDocumentFragment(),r=o.appendChild(document.createElement("span"));return r.className=t,r.textContent=e,o.appendChild(document.createTextNode(": ")),o.appendChild(se(n,!0)),o}function H(e,n){const t=document.createDocumentFragment();return t.appendChild(se(e,!0)),t.appendChild(document.createTextNode(" => ")),t.appendChild(se(n,!0)),t}function K(e,n){var t=e+"",o=t.length;return o<n?new Array(n-o+1).join(0)+t:t}function Y(e){return e<0?"-"+K(-e,6):e>9999?"+"+K(e,6):K(e,4)}var G=Error.prototype.toString;var J=RegExp.prototype.toString;function V(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,X)}function X(e){var n=e.charCodeAt(0);switch(n){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return n<16?"\\x0"+n.toString(16):n<32?"\\x"+n.toString(16):"\\"+e}function Q(e,n){for(var t=0;n.exec(e);)++t;return t}var W=Function.prototype.toString,Z={prefix:"async ƒ"},ee={prefix:"async ƒ*"},ne={prefix:"class"},te={prefix:"ƒ"},oe={prefix:"ƒ*"};function re(e,n,t){var o=document.createElement("span");o.className="observablehq--function",t&&o.appendChild(r(t));var a=o.appendChild(document.createElement("span"));return a.className="observablehq--keyword",a.textContent=e.prefix,o.appendChild(document.createTextNode(n)),o}const{prototype:{toString:ae}}=Object;function se(e,n,t,o,a){let c=typeof e;switch(c){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=s(e);break;case"function":return function(e,n){var t,o,r=W.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":t=Z;break;case"AsyncGeneratorFunction":t=ee;break;case"GeneratorFunction":t=oe;break;default:t=/^class\b/.test(r)?ne:te}return t===ne?re(t,"",n):(o=/^(?:async\s*)?(\w+)\s*=>/.exec(r))?re(t,"("+o[1]+")",n):(o=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))||(o=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(r))?re(t,o[1]?"("+o[1].replace(/\s*,\s*/g,", ")+")":"()",n):re(t,"(…)",n)}(e,o);case"string":return function(e,n,t,o){if(!1===n){if(Q(e,/["\n]/g)<=Q(e,/`|\${/g)){const n=document.createElement("span");o&&n.appendChild(r(o));const t=n.appendChild(document.createElement("span"));return t.className="observablehq--string",t.textContent=JSON.stringify(e),n}const a=e.split("\n");if(a.length>20&&!t){const t=document.createElement("div");o&&t.appendChild(r(o));const s=t.appendChild(document.createElement("span"));s.className="observablehq--string",s.textContent="`"+V(a.slice(0,20).join("\n"));const c=t.appendChild(document.createElement("span")),i=a.length-20;return c.textContent=`Show ${i} truncated line${i>1?"s":""}`,c.className="observablehq--string-expand",c.addEventListener("mouseup",(function(r){r.stopPropagation(),ce(t,se(e,n,!0,o))})),t}const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className="observablehq--string"+(t?" observablehq--expanded":""),c.textContent="`"+V(e)+"`",s}const a=document.createElement("span");o&&a.appendChild(r(o));const s=a.appendChild(document.createElement("span"));return s.className="observablehq--string",s.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),a}(e,n,t,o);default:if(null===e){c=null,e="null";break}if(e instanceof Date){c="date",i=e,e=isNaN(i)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(i)?Y(i.getUTCFullYear())+"-"+K(i.getUTCMonth()+1,2)+"-"+K(i.getUTCDate(),2):Y(i.getFullYear())+"-"+K(i.getMonth()+1,2)+"-"+K(i.getDate(),2)+"T"+K(i.getHours(),2)+":"+K(i.getMinutes(),2)+(i.getMilliseconds()?":"+K(i.getSeconds(),2)+"."+K(i.getMilliseconds(),3):i.getSeconds()?":"+K(i.getSeconds(),2):"");break}if(e===d){c="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":c="regexp",e=function(e){return J.call(e)}(e);break;case"[object Error]":case"[object DOMException]":c="error",e=function(e){return e.stack||G.call(e)}(e);break;default:return(t?g:U)(e,n,o,a)}}var i;const l=document.createElement("span");o&&l.appendChild(r(o));const u=l.appendChild(document.createElement("span"));return u.className=`observablehq--${c}`,u.textContent=e,l}function ce(e,t){e.classList.contains("observablehq--inspect")&&t.classList.add("observablehq--inspect"),e.parentNode.replaceChild(t,e),n(t,"load")}const ie=/\s+\(\d+:\d+\)$/m;class le{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,t){const{_node:o}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(e)||e.parentNode&&e.parentNode!==o)&&(e=se(e,!1,o.firstChild&&o.firstChild.classList&&o.firstChild.classList.contains("observablehq--expanded"),t)).classList.add("observablehq--inspect"),o.classList.remove("observablehq--running","observablehq--error"),o.firstChild!==e)if(o.firstChild){for(;o.lastChild!==o.firstChild;)o.removeChild(o.lastChild);o.replaceChild(e,o.firstChild)}else o.appendChild(e);n(o,"update")}rejected(e,t){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var a=document.createElement("div");a.className="observablehq--inspect",t&&a.appendChild(r(t)),a.appendChild(document.createTextNode((e+"").replace(ie,""))),o.appendChild(a),n(o,"error",{error:e})}}le.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new le(e.appendChild(document.createElement("div")))}},e.Inspector=le,Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "@observablehq/inspector",
"version": "3.2.2",
"version": "3.2.3",
"license": "ISC",

@@ -5,0 +5,0 @@ "main": "dist/inspector.js",

@@ -20,3 +20,3 @@ import dispatch from "./dispatch.js";

const {_node} = this;
if (!(value instanceof Element || value instanceof Text) || (value.parentNode && value.parentNode !== _node)) {
if (!isnode(value) || (value.parentNode && value.parentNode !== _node)) {
value = inspect(value, false, _node.firstChild // TODO Do this better.

@@ -61,1 +61,11 @@ && _node.firstChild.classList

};
// Returns true if the given value is something that should be added to the DOM
// by the inspector, rather than being inspected. This deliberately excludes
// DocumentFragment since appending a fragment “dissolves” (mutates) the
// fragment, and we wish for the inspector to not have side-effects. Also,
// HTMLElement.prototype is an instanceof Element, but not an element!
function isnode(value) {
return (value instanceof Element || value instanceof Text)
&& (value instanceof value.constructor);
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc