UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

10 lines (9 loc) 256 B
/** * * @param value value to check if NaN * @param [valueIfNaN] * @returns `fallback` is `value is NaN */ export const ifNaN = (value: number, valueIfNaN?: number) => { return isNaN(value) && typeof valueIfNaN === 'number' ? valueIfNaN : value; };