UNPKG

gedi

Version:
17 lines (14 loc) 442 B
var WM; if(typeof WeakMap !== 'undefined'){ WM = WeakMap; }else if(typeof window !== 'undefined'){ var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer'){ var match = navigator.userAgent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/); if (match && match[1] <= 9){ WM = require('leak-map'); } } } WM || (WM = require('weak-map')); module.exports = WM;