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

drawable

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drawable - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

17

dist/image.js

@@ -15,9 +15,20 @@ 'use strict';

var _isBuffer = require('is-buffer');
var _isBuffer2 = _interopRequireDefault(_isBuffer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const { loadImage } = _canvas2.default;
const { loadImage, Image } = _canvas2.default;
class DrawableImage {
constructor(img, styles = {}) {
this._img = img;
// be able to set image buffer
if ((0, _isBuffer2.default)(img)) {
this._image = new Image();
this._image.src = img;
this._dimensions = (0, _imageSize2.default)(img);
} else {
this._img = img;
}
this._styles = styles;

@@ -28,3 +39,3 @@ }

return loadImage(this._img).then(image => {
this._dimensions = (0, _imageSize2.default)(this._img);
this._dimensions = (0, _imageSize2.default)(image);
this._image = image;

@@ -31,0 +42,0 @@ });

5

package.json
{
"name": "drawable",
"version": "0.2.1",
"version": "0.3.0",
"description": "A way to make styling canvas elements like text and images nicer",

@@ -16,3 +16,4 @@ "main": "dist/index.js",

"canvas": "2.0.0-alpha.4",
"image-size": "^0.6.1"
"image-size": "^0.6.1",
"is-buffer": "^1.1.5"
},

@@ -19,0 +20,0 @@ "devDependencies": {

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