MCPcopy Create free account
hub / github.com/microsoft/SandDance / logImageInBrowser

Function logImageInBrowser

docs/app/js/sanddance-app.js:58359–58382  ·  view source on GitHub ↗
(_ref3)

Source from the content-addressed store, hash-verified

58357 return noop;
58358}
58359function logImageInBrowser(_ref3) {
58360 let { image , message ="" , scale =1 } = _ref3;
58361 if (typeof image === "string") {
58362 const img = new Image();
58363 img.onload = ()=>{
58364 const args = (0, _formatters.formatImage)(img, message, scale);
58365 console.log(...args);
58366 };
58367 img.src = image;
58368 return noop;
58369 }
58370 const element = image.nodeName || "";
58371 if (element.toLowerCase() === "img") {
58372 console.log(...(0, _formatters.formatImage)(image, message, scale));
58373 return noop;
58374 }
58375 if (element.toLowerCase() === "canvas") {
58376 const img = new Image();
58377 img.onload = ()=>console.log(...(0, _formatters.formatImage)(img, message, scale));
58378 img.src = image.toDataURL();
58379 return noop;
58380 }
58381 return noop;
58382}
58383function getTableHeader(table) {
58384 for(const key in table){
58385 for(const title in table[key])return title || "untitled";

Callers 1

imageMethod · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected