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

@observablehq/stdlib

Package Overview
Dependencies
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@observablehq/stdlib - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

4

dist/stdlib.js

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

// @observablehq/stdlib v2.0.5 Copyright 2018 Observable, Inc.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e){return function(){return e}}var n={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var r=0;function o(e){this.id=e,this.href=window.location.href+"#"+e}o.prototype.toString=function(){return"url("+this.href+")"};var i={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var r,o=e+="",i=o.indexOf(":");i>=0&&"xmlns"!==(o=e.slice(0,i))&&(e=e.slice(i+1));var u=n.hasOwnProperty(o)?document.createElementNS(n[o],e):document.createElement(e);if(t)for(var a in t)i=(o=a).indexOf(":"),r=t[a],i>=0&&"xmlns"!==(o=a.slice(0,i))&&(a=a.slice(i+1)),n.hasOwnProperty(o)?u.setAttributeNS(n[o],a,r):u.setAttribute(a,r);return u},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new o("O-"+(null==e?"":e+"-")+ ++r)}};var u={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function a(){return this}function l(e,t){let n=!1;return{[Symbol.iterator]:a,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function c(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:a,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function s(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var f={disposable:l,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return c(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=s(e);function o(){t(s(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:c,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:a,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return l(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function d(e,t){return function(n){var r,o,i,u,a,l,c,s,f=n[0],d=[],m=null,h=-1;for(a=1,l=arguments.length;a<l;++a){if((r=arguments[a])instanceof Node)d[++h]=r,f+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(c=0,s=r.length;c<s;++c)(o=r[c])instanceof Node?(null===m&&(d[++h]=m=document.createDocumentFragment(),f+="\x3c!--o:"+h+"--\x3e"),m.appendChild(o)):(m=null,f+=o);m=null}else f+=r;f+=n[a]}if(m=e(f),++h>0){for(i=new Array(h),u=document.createTreeWalker(m,NodeFilter.SHOW_COMMENT,null,!1);u.nextNode();)o=u.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(a=0;a<h;++a)(o=i[a])&&o.parentNode.replaceChild(d[a],o)}return 1===m.childNodes.length?m.removeChild(m.firstChild):11===m.nodeType?((o=t()).appendChild(m),o):m}}var m=d(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function h(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return d(function(n){var r=document.createElement("span");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("span")})})}}function v(e){let t;Object.defineProperties(this,{generator:{value:c(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*w(){for(;;)yield Date.now()}var p=new Map;function b(e,n){var r;return(r=p.get(e=+e))?r.then(t(n)):(r=Date.now())>=e?Promise.resolve(n):function(e,t){var n=new Promise(function(n){p.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return p.set(t,n),n}(r,e).then(t(n))}var g={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return b(Math.ceil((Date.now()+1)/e)*e,t)},when:b};function x(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const y=new Map,E=[],P=E.map,k=E.some,L=E.hasOwnProperty,A="https://unpkg.com/",C=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,M=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/;class RequireError extends Error{constructor(e){super(e)}}function j(e){return"string"==typeof e?e:""}function $(e){const t=C.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function N(e){const t=`${A}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=y.get(t);return n||y.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!y.has(e.url)&&y.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const O=R(async function(e,t){if(e.startsWith(A)&&(e=e.substring(A.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=$(e);if(!n)return`${A}${e}`;if(!n.version&&null!=t&&t.startsWith(A)){const e=await N($(t.substring(A.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&n.version&&M.test(n.version))return`${A}${n.name}@${n.version}/${n.path}`;const r=await N(n);return`${A}${r.name}@${r.version}/${n.path||j(r.unpkg)||j(r.browser)||j(r.main)||"index.js"}`});function R(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(E.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=D,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(P.call(arguments,n)).then(S):n(e)}return i.alias=function(t){return R((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function S(e){const t={};for(const n of e)for(const e in n)L.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:U(n,e)}):t[e]=n[e]);return t}function U(e,t){return()=>e[t]}function q(e){return e+""=="exports"}function D(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),E.push(k.call(t,q)?e=>{const r={};return Promise.all(P.call(t,t=>q(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(P.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function T(e){return null==e?O:R(e)}D.amd={};var F=d(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),W=String.raw;function _(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function B(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(_)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(W.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function H(){return c(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}e.Library=function(e){const n=T(e);Object.defineProperties(this,{DOM:{value:i,writable:!0,enumerable:!0},Files:{value:u,writable:!0,enumerable:!0},Generators:{value:f,writable:!0,enumerable:!0},html:{value:t(m),writable:!0,enumerable:!0},md:{value:h(n),writable:!0,enumerable:!0},Mutable:{value:t(v),writable:!0,enumerable:!0},now:{value:w,writable:!0,enumerable:!0},Promises:{value:g,writable:!0,enumerable:!0},require:{value:t(n),writable:!0,enumerable:!0},resolve:{value:t(x),writable:!0,enumerable:!0},svg:{value:t(F),writable:!0,enumerable:!0},tex:{value:B(n),writable:!0,enumerable:!0},width:{value:H,writable:!0,enumerable:!0}})},Object.defineProperty(e,"__esModule",{value:!0})});
// @observablehq/stdlib v2.0.6 Copyright 2019 Observable, Inc.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e){return function(){return e}}var n={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var r=0;function o(e){this.id=e,this.href=window.location.href+"#"+e}o.prototype.toString=function(){return"url("+this.href+")"};var i={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var r,o=e+="",i=o.indexOf(":");i>=0&&"xmlns"!==(o=e.slice(0,i))&&(e=e.slice(i+1));var u=n.hasOwnProperty(o)?document.createElementNS(n[o],e):document.createElement(e);if(t)for(var a in t)i=(o=a).indexOf(":"),r=t[a],i>=0&&"xmlns"!==(o=a.slice(0,i))&&(a=a.slice(i+1)),n.hasOwnProperty(o)?u.setAttributeNS(n[o],a,r):u.setAttribute(a,r);return u},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new o("O-"+(null==e?"":e+"-")+ ++r)}};var u={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function a(){return this}function l(e,t){let n=!1;return{[Symbol.iterator]:a,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function c(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:a,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function s(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var f={disposable:l,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return c(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=s(e);function o(){t(s(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:c,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:a,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return l(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function d(e,t){return function(n){var r,o,i,u,a,l,c,s,f=n[0],d=[],m=null,h=-1;for(a=1,l=arguments.length;a<l;++a){if((r=arguments[a])instanceof Node)d[++h]=r,f+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(c=0,s=r.length;c<s;++c)(o=r[c])instanceof Node?(null===m&&(d[++h]=m=document.createDocumentFragment(),f+="\x3c!--o:"+h+"--\x3e"),m.appendChild(o)):(m=null,f+=o);m=null}else f+=r;f+=n[a]}if(m=e(f),++h>0){for(i=new Array(h),u=document.createTreeWalker(m,NodeFilter.SHOW_COMMENT,null,!1);u.nextNode();)o=u.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(a=0;a<h;++a)(o=i[a])&&o.parentNode.replaceChild(d[a],o)}return 1===m.childNodes.length?m.removeChild(m.firstChild):11===m.nodeType?((o=t()).appendChild(m),o):m}}var m=d(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function h(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return d(function(n){var r=document.createElement("span");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("span")})})}}function v(e){let t;Object.defineProperties(this,{generator:{value:c(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*w(){for(;;)yield Date.now()}var p=new Map;function b(e,n){var r;return(r=p.get(e=+e))?r.then(t(n)):(r=Date.now())>=e?Promise.resolve(n):function(e,t){var n=new Promise(function(n){p.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return p.set(t,n),n}(r,e).then(t(n))}var g={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return b(Math.ceil((Date.now()+1)/e)*e,t)},when:b};function x(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const y=new Map,E=[],P=E.map,k=E.some,L=E.hasOwnProperty,j="https://cdn.jsdelivr.net/npm/",A=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,C=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,M=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function $(e){const t=A.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function N(e){const t=`${j}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=y.get(t);return n||y.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!y.has(e.url)&&y.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const O=R(async function(e,t){if(e.startsWith(j)&&(e=e.substring(j.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=$(e);if(!n)return`${j}${e}`;if(!n.version&&null!=t&&t.startsWith(j)){const e=await N($(t.substring(j.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!/\.[^\/]*$/.test(n.path)&&(n.path+=".js"),n.path&&n.version&&C.test(n.version))return`${j}${n.name}@${n.version}/${n.path}`;const r=await N(n);return`${j}${r.name}@${r.version}/${n.path||function(e){for(const t of M){const n=e[t];if("string"==typeof n)return n}}(r)||"index.js"}`});function R(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(E.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=D,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(P.call(arguments,n)).then(S):n(e)}return i.alias=function(t){return R((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function S(e){const t={};for(const n of e)for(const e in n)L.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:U(n,e)}):t[e]=n[e]);return t}function U(e,t){return()=>e[t]}function q(e){return e+""=="exports"}function D(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),E.push(k.call(t,q)?e=>{const r={};return Promise.all(P.call(t,t=>q(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(P.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function T(e){return null==e?O:R(e)}D.amd={};var F=d(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),W=String.raw;function _(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function B(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(_)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(W.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function H(){return c(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}e.Library=function(e){const n=T(e);Object.defineProperties(this,{DOM:{value:i,writable:!0,enumerable:!0},Files:{value:u,writable:!0,enumerable:!0},Generators:{value:f,writable:!0,enumerable:!0},html:{value:t(m),writable:!0,enumerable:!0},md:{value:h(n),writable:!0,enumerable:!0},Mutable:{value:t(v),writable:!0,enumerable:!0},now:{value:w,writable:!0,enumerable:!0},Promises:{value:g,writable:!0,enumerable:!0},require:{value:t(n),writable:!0,enumerable:!0},resolve:{value:t(x),writable:!0,enumerable:!0},svg:{value:t(F),writable:!0,enumerable:!0},tex:{value:B(n),writable:!0,enumerable:!0},width:{value:H,writable:!0,enumerable:!0}})},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "@observablehq/stdlib",
"version": "2.0.5",
"version": "2.0.6",
"license": "ISC",

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

@@ -715,3 +715,3 @@ # @observablehq/stdlib

Returns a promise of the [asynchronous module definition](https://github.com/amdjs/amdjs-api/blob/master/AMD.md) (AMD) with the specified *names*, loaded from [unpkg](https://unpkg.com/). Each module *name* can be a package (or scoped package) name optionally followed by the at sign (`@`) and a semver range. For example, to load [d3-array](https://github.com/d3/d3-array):
Returns a promise of the [asynchronous module definition](https://github.com/amdjs/amdjs-api/blob/master/AMD.md) (AMD) with the specified *names*, loaded from [jsDelivr](https://jsdelivr.com/). Each module *name* can be a package (or scoped package) name optionally followed by the at sign (`@`) and a semver range. For example, to load [d3-array](https://github.com/d3/d3-array):

@@ -741,3 +741,3 @@ ```js

```js
require.resolve("d3-array") // "https://unpkg.com/d3-array@1.2.1/build/d3-array.js"
require.resolve("d3-array") // "https://cdn.jsdelivr.net/npm/d3-array@2.0.3/dist/d3-array.min.js"
```

@@ -744,0 +744,0 @@

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