This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs-blog-newsletter/cronjob/node_modules/@aws-crypto/ie11-detection/build/MsWindow.js

32 lines
1 KiB
JavaScript
Raw Normal View History

2024-05-26 22:54:55 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMsWindow = void 0;
var msSubtleCryptoMethods = [
"decrypt",
"digest",
"encrypt",
"exportKey",
"generateKey",
"importKey",
"sign",
"verify"
];
function quacksLikeAnMsWindow(window) {
return "MSInputMethodContext" in window && "msCrypto" in window;
}
/**
* Determines if the provided window is (or is like) the window object one would
* expect to encounter in Internet Explorer 11.
*/
function isMsWindow(window) {
if (quacksLikeAnMsWindow(window) && window.msCrypto.subtle !== undefined) {
var _a = window.msCrypto, getRandomValues = _a.getRandomValues, subtle_1 = _a.subtle;
return msSubtleCryptoMethods
.map(function (methodName) { return subtle_1[methodName]; })
.concat(getRandomValues)
.every(function (method) { return typeof method === "function"; });
}
return false;
}
exports.isMsWindow = isMsWindow;
//# sourceMappingURL=MsWindow.js.map