Make createTransformToString a standalone function

This commit is contained in:
Andreas Hocevar
2020-03-12 11:46:40 +01:00
parent 3f5022630b
commit 56edbb2d73
5 changed files with 44 additions and 22 deletions
+14
View File
@@ -45,6 +45,20 @@ export const DEVICE_PIXEL_RATIO = (function() {
}
})();
/**
* The execution context is a window.
* @const
* @type {boolean}
*/
export const WINDOW = (function() {
try {
return 'document' in self;
} catch (e) {
// ancient browsers don't have `self`
return true;
}
})();
/**
* Image.prototype.decode() is supported.
* @type {boolean}