all files / src/ util.js

80% Statements 12/15
50% Branches 3/6
100% Functions 2/2
80% Lines 12/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34        19× 19× 19× 19×         19×         19×                    
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
var getIEVer = function getIEVer() {
  Eif (window) {
    var ua = window.navigator.userAgent;
    var idx = ua.indexOf('MSIE');
    Iif (idx > 0) {
      // "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64;
      // Trident/6.0; SLCC2; .NET CLR 2.0.50727)"
      return parseInt(ua.substring(idx + 5, ua.indexOf('.', idx)), 10);
    }
    Iif (ua.match(/Trident\/7\./)) {
      // "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0;
      // SLCC2; .NET CLR 2.0.50727; rv:11.0) like Gecko"
      return 11;
    }
    return 0;
  }
  return 0;
};
 
var trim = function trim(str) {
  return str.replace(/(^\s+|\s+$)/g, '');
};
 
exports['default'] = {
  getIEVer: getIEVer,
  trim: trim
};
module.exports = exports['default'];