New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

2d-context

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

2d-context - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

20

index.js

@@ -1,15 +0,5 @@

module.exports = function createCanvas2D(opt) {
if (typeof document === 'undefined')
return null
opt = opt||{}
var canvas = opt.canvas || document.createElement('canvas')
if (typeof opt.width === 'number')
canvas.width = opt.width
if (typeof opt.height === 'number')
canvas.height = opt.height
try {
return canvas.getContext('2d', opt) || null
} catch (e) {
return null
}
}
var getContext = require('get-canvas-context')
module.exports = function get2DContext (opt) {
return getContext('2d', opt)
}
{
"name": "2d-context",
"version": "1.2.0",
"version": "1.3.0",
"description": "grabs a new 2d canvas context",

@@ -12,3 +12,5 @@ "main": "index.js",

},
"dependencies": {},
"dependencies": {
"get-canvas-context": "^1.0.1"
},
"devDependencies": {

@@ -22,3 +24,4 @@ "browserify": "^8.0.2",

"test-node": "node test-node.js | faucet",
"test": "browserify test.js | testling | faucet"
"test-browser": "browserify test.js | testling | faucet",
"test": "npm run test-browser && npm run test-node"
},

@@ -25,0 +28,0 @@ "keywords": [

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