is-canvas-context
v1.0.0
Published
varify variabe is a canvas context
Downloads
80
Maintainers
Readme
is-canvas-context
varify a variable is a canvas context
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install is-canvas-context --save
Usage
import isCanvasContext from './'
let canvas = document.createElement('canvas')
isCanvasContext(canvas) // false
isCanvasContext(canvas.getContext('2d')) // true
isCanvasContext('not a context or canvas') // false
API
isCanvasContext(ctx:any):boolean
License
ISC