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.2 to 2.0.3

src/dom/canvas.js

2

dist/stdlib.js

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

// @observablehq/stdlib v2.0.2 Copyright 2018 Observable, Inc.
// @observablehq/stdlib v2.0.3 Copyright 2018 Observable, Inc.
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function n(e){return function(){return e}}var t={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,n){var t=document.createElement("canvas");return t.width=e,t.height=n,t},context2d:function(e,n,t){null==t&&(t=devicePixelRatio);var r=document.createElement("canvas");r.width=e*t,r.height=n*t,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(t,t),o},download:function(e,n,t){var r=document.createElement("a");return r.appendChild(document.createElement("button")).textContent=null==t?"Download":t,r.download=null==n?"untitled":n,r.onclick=function(){var n=r.href=URL.createObjectURL(e);setTimeout(function(){URL.revokeObjectURL(n)},50)},r},element:function(e,n){var r,o=e+="",i=o.indexOf(":");i>=0&&"xmlns"!==(o=e.slice(0,i))&&(e=e.slice(i+1));var u=t.hasOwnProperty(o)?document.createElementNS(t[o],e):document.createElement(e);if(n)for(var l in n)i=(o=l).indexOf(":"),r=n[l],i>=0&&"xmlns"!==(o=l.slice(0,i))&&(l=l.slice(i+1)),t.hasOwnProperty(o)?u.setAttributeNS(t[o],l,r):u.setAttribute(l,r);return u},input:function(e){var n=document.createElement("input");return null!=e&&(n.type=e),n},range:function(e,n,t){1===arguments.length&&(n=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=n=null==n?1:+n,r.step=null==t?"any":t=+t,r.type="range",r},select:function(e){var n=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var t=document.createElement("option");t.value=t.textContent=e,n.appendChild(t)}),n},svg:function(e,n){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox",[0,0,e,n]),t.setAttribute("width",e),t.setAttribute("height",n),t},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(n,t){var r=new FileReader;r.onload=function(){n(r.result)},r.onerror=t,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(n,t){var r=new FileReader;r.onload=function(){n(r.result)},r.onerror=t,r.readAsText(e)})},url:function(e){return new Promise(function(n,t){var r=new FileReader;r.onload=function(){n(r.result)},r.onerror=t,r.readAsDataURL(e)})}};function l(){return this}function a(e,n){let t=!1;return{[Symbol.iterator]:l,next:()=>t?{done:!0}:(t=!0,{done:!1,value:e}),return:()=>(t=!0,n(e),{done:!0}),throw:()=>({done:t=!0})}}function c(e){let n,t,r=!1;const o=e(function(e){t?(t(e),t=null):r=!0;return n=e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(n)):new Promise(e=>t=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:a,filter:function*(e,n){for(var t,r=-1;!(t=e.next()).done;)n(t.value,++r)&&(yield t.value)},input:function(e){return c(function(n){var t=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(){n(s(e))}return e.addEventListener(t,o),void 0!==r&&n(r),function(){e.removeEventListener(t,o)}})},map:function*(e,n){for(var t,r=-1;!(t=e.next()).done;)yield n(t.value,++r)},observe:c,queue:function(e){let n;const t=[],r=e(function(e){return t.push(e),n&&(n(t.shift()),n=null),e});return{[Symbol.iterator]:l,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:t.length?Promise.resolve(t.shift()):new Promise(e=>n=e)}}}},range:function*(e,n,t){e=+e,n=+n,t=(o=arguments.length)<2?(n=e,e=0,1):o<3?1:+t;for(var r=-1,o=0|Math.max(0,Math.ceil((n-e)/t));++r<o;)yield e+r*t},valueAt:function(e,n){if(!(!isFinite(n=+n)||n<0||n!=n|0))for(var t,r=-1;!(t=e.next()).done;)if(++r===n)return t.value},worker:function(e){const n=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),t=new Worker(n);return a(t,()=>{t.terminate(),URL.revokeObjectURL(n)})}};function d(e,n){return function(t){var r,o,i,u,l,a,c,s,f=t[0],d=[],m=null,h=-1;for(l=1,a=arguments.length;l<a;++l){if((r=arguments[l])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+=t[l]}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(l=0;l<h;++l)(o=i[l])&&o.parentNode.replaceChild(d[l],o)}return 1===m.childNodes.length?m.removeChild(m.firstChild):11===m.nodeType?((o=n()).appendChild(m),o):m}}var m=d(function(e){var n=document.createElement("template");return n.innerHTML=e.trim(),document.importNode(n.content,!0)},function(){return document.createElement("span")});function h(e){let n;Object.defineProperties(this,{generator:{value:c(e=>void(n=e))},value:{get:()=>e,set:t=>n(e=t)}}),void 0!==e&&n(e)}function*v(){for(;;)yield Date.now()}var w=new Map;function p(e,t){var r;return(r=w.get(e=+e))?r.then(n(t)):(r=Date.now())>=e?Promise.resolve(t):function(e,n){var t=new Promise(function(t){w.delete(n);var r=n-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(t,r)});return w.set(n,t),t}(r,e).then(n(t))}var b={delay:function(e,n){return new Promise(function(t){setTimeout(function(){t(n)},e)})},tick:function(e,n){return p(Math.ceil((Date.now()+1)/e)*e,n)},when:p};function g(e,n){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==n?location:n).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const x=new Map,y=[],E=y.map,k=y.some,P=y.hasOwnProperty,L="https://unpkg.com/",M=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,j=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/;class RequireError extends Error{constructor(e){super(e)}}function $(e){return"string"==typeof e?e:""}function A(e){const n=M.exec(e);return n&&{name:n[1],version:n[2],path:n[3]}}function N(e){const n=`${L}${e.name}${e.version?`@${e.version}`:""}/package.json`;let t=x.get(n);return t||x.set(n,t=fetch(n).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!x.has(e.url)&&x.set(e.url,t),e.json()})),t}RequireError.prototype.name=RequireError.name;const O=C(async function(e,n){if(e.startsWith(L)&&(e=e.substring(L.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==n?location:n).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const t=A(e);if(!t)return`${L}${e}`;if(!t.version&&null!=n&&n.startsWith(L)){const e=await N(A(n.substring(L.length)));t.version=e.dependencies&&e.dependencies[t.name]||e.peerDependencies&&e.peerDependencies[t.name]}if(t.path&&t.version&&j.test(t.version))return`${L}${t.name}@${t.version}/${t.path}`;const r=await N(t);return`${L}${r.name}@${r.version}/${t.path||$(r.unpkg)||$(r.browser)||$(r.main)||"index.js"}`});function C(e){const n=new Map,t=o(null);function r(e){if("string"!=typeof e)return e;let t=n.get(e);return t||n.set(e,t=new Promise((n,t)=>{const r=document.createElement("script");r.onload=(()=>{try{n(y.pop()(o(e)))}catch(e){t(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{t(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=U,document.head.appendChild(r)})),t}function o(n){return t=>Promise.resolve(e(t,n)).then(r)}function i(e){return arguments.length>1?Promise.all(E.call(arguments,t)).then(R):t(e)}return i.alias=function(n){return C((t,r)=>t in n&&(r=null,"string"!=typeof(t=n[t]))?t:e(t,r))},i.resolve=e,i}function R(e){const n={};for(const t of e)for(const e in t)P.call(t,e)&&(null==t[e]?Object.defineProperty(n,e,{get:S(t,e)}):n[e]=t[e]);return n}function S(e,n){return()=>e[n]}function T(e){return e+""=="exports"}function U(e,n,t){const r=arguments.length;r<2?(t=e,n=[]):r<3&&(t=n,n="string"==typeof e?[]:e),y.push(k.call(n,T)?e=>{const r={};return Promise.all(E.call(n,n=>T(n+="")?r:e(n))).then(e=>(t.apply(null,e),r))}:e=>Promise.all(E.call(n,e)).then(e=>"function"==typeof t?t.apply(null,e):t))}function D(e){return null==e?O:C(e)}U.amd={};var q=d(function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.innerHTML=e.trim(),n},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),F=String.raw;function W(e){return new Promise(function(n,t){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=t,r.onload=n,document.head.appendChild(r)})}function _(){return c(function(e){var n=e(document.body.clientWidth);function t(){var t=document.body.clientWidth;t!==n&&e(n=t)}return window.addEventListener("resize",t),function(){window.removeEventListener("resize",t)}})}e.Library=function(e){const t=D(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:n(m),writable:!0,enumerable:!0},md:{value:function(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(n){return d(function(t){var r=document.createElement("span");r.innerHTML=n(t,{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(n){e.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("span")})})}}(t),writable:!0,enumerable:!0},Mutable:{value:n(h),writable:!0,enumerable:!0},now:{value:v,writable:!0,enumerable:!0},Promises:{value:b,writable:!0,enumerable:!0},require:{value:n(t),writable:!0,enumerable:!0},resolve:{value:n(g),writable:!0,enumerable:!0},svg:{value:n(q),writable:!0,enumerable:!0},tex:{value:function(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(W)]).then(function(e){var n=e[0],t=r();function r(e){return function(){var t=document.createElement("div");return n.render(F.apply(String,arguments),t,e),t.removeChild(t.firstChild)}}return t.options=r,t.block=r({displayMode:!0}),t})}}(t),writable:!0,enumerable:!0},width:{value:_,writable:!0,enumerable:!0}})},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "@observablehq/stdlib",
"version": "2.0.2",
"version": "2.0.3",
"license": "ISC",

@@ -30,4 +30,4 @@ "main": "dist/stdlib.js",

"files": [
"src/**.js",
"dist/**.js"
"src/**/*.js",
"dist/**/*.js"
],

@@ -34,0 +34,0 @@ "dependencies": {

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