Skip to content

Commit

Permalink
Use tiny-invariant over as
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen authored and efrenaragon96 committed Jun 5, 2023
1 parent 62e3a67 commit cb6818f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/addons/measure/src/box-model/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function getDocumentWidthAndHeight() {
function createCanvas(): CanvasState {
const canvas = global.document.createElement('canvas');
canvas.id = 'storybook-addon-measure';
const context = canvas.getContext('2d') as CanvasRenderingContext2D;
const context = canvas.getContext('2d');
invariant(context != null);
// Set canvas width & height
const { width, height } = getDocumentWidthAndHeight();
setCanvasWidthAndHeight(canvas, context, { width, height });
Expand Down

0 comments on commit cb6818f

Please sign in to comment.