diff --git a/lib/can-promise.js b/lib/can-promise.js new file mode 100644 index 00000000..77267f15 --- /dev/null +++ b/lib/can-promise.js @@ -0,0 +1,7 @@ +// can-promise has a crash in some versions of react native that dont have +// standard global objects +// https://github.com/soldair/node-qrcode/issues/157 + +module.exports = function () { + return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then +}