| 1 | /** |
| 2 | * Simple mixin to allow all widgets to use `apiBool` |
| 3 | * |
| 4 | * @class |
| 5 | * @private |
| 6 | * @constructor |
| 7 | */ |
| 8 | function UtilMixin() { |
| 9 | // Nothing |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Test an API boolean |
| 14 | * |
| 15 | * @param {any} value |
| 16 | * @return {boolean} |
| 17 | */ |
| 18 | UtilMixin.prototype.apiBool = function ( value ) { |
| 19 | return value !== undefined && value !== false; |
| 20 | }; |
| 21 | |
| 22 | module.exports = UtilMixin; |