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

@jasonsbarr/htdp-image

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jasonsbarr/htdp-image - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.7.0",
"version": "0.7.1",
"main": "./dist/index.cjs",

@@ -11,0 +11,0 @@ "source": "./src/index.js",

@@ -45,3 +45,3 @@ # HTDP/Image.js

```html
<script src="https://www.unpkg.com/@jasonsbarr/htdp-image@0.7.0/dist/index.umd.js"></script>
<script src="https://www.unpkg.com/@jasonsbarr/htdp-image@0.7.1/dist/index.umd.js"></script>

@@ -48,0 +48,0 @@ <script>

@@ -50,2 +50,28 @@ import {

/**
* Makes a file image from a source URL
* @param {string} src
* @returns {ImageLib.FileImage}
*/
export const imageURL = (src) => {
const rawImage = document.createElement("img");
rawImage.src = src;
return ImageLib.makeFileImage(src, rawImage);
};
export const bitmapURL = imageURL;
/**
* Makes a file video from a source URL
* @param {string} src
* @returns {ImageLib.FileVideo}
*/
export const videoURL = (src) => {
const rawVideo = document.createElement("video");
rawVideo.src = src;
return ImageLib.makeFileVideo(src, rawVideo);
};
/**
* Makes a simple text image with sensible defaults

@@ -1301,2 +1327,14 @@ * @param {string} str

export const isAngle = ImageLib.isAngle;
export const isSideCount = ImageLib.isSideCount;
export const isStepCount = ImageLib.isStepCount;
export const isImage = ImageLib.isImage;
export const imagesDifference = ImageLib.imageDifference;
export const imagesEqual = ImageLib.imageEquals;
/**

@@ -1391,29 +1429,1 @@ * Gets the color at a given x/y coordinate

ImageLib.makeSceneImage(0, 0, [], true, Colors.transparent);
export const imageURL = (src) => {
const rawImage = document.createElement("img");
rawImage.src = src;
return ImageLib.makeFileImage(src, rawImage);
};
export const videoURL = (src) => {
const rawVideo = document.createElement("video");
rawVideo.src = src;
return ImageLib.makeFileVideo(src, rawVideo);
};
export const isAngle = ImageLib.isAngle;
export const isSideCount = ImageLib.isSideCount;
export const isStepCount = ImageLib.isStepCount;
export const isImage = ImageLib.isImage;
export const bitmapURL = imageURL;
export const imagesDifference = ImageLib.imageDifference;
export const imagesEqual = ImageLib.imageEquals;

@@ -25,5 +25,15 @@ let jsdom = {};

</html>`;
const dom = new jsdom.JSDOM(html);
document = dom.window.document;
let dom;
if (jsdom.JSDOM === undefined) {
let interval = setInterval(() => {
if (jsdom.JSDOM) {
dom = new jsdom.JSDOM(html);
document = dom.window.document;
clearInterval(interval);
}
}, 100);
} else {
dom = new jsdom.JSDOM(html);
document = dom.window.document;
}
} else {

@@ -30,0 +40,0 @@ document = window.document;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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