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": [ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3397
1
9
1
+ Addedget-canvas-context@^1.0.1
+ Addedget-canvas-context@1.0.2(transitive)