From d4e80a6c5038148bf652cc6c53e032dee9c65350 Mon Sep 17 00:00:00 2001 From: William Costa Date: Tue, 7 May 2019 10:51:40 -0300 Subject: [PATCH] Update dependencies and fix vulnerabilities --- dist/dhalsim.js | 76 ++++++++++++++------------------------------- dist/dhalsim.min.js | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 26 insertions(+), 56 deletions(-) diff --git a/dist/dhalsim.js b/dist/dhalsim.js index bfcb40b..d330917 100755 --- a/dist/dhalsim.js +++ b/dist/dhalsim.js @@ -1,6 +1,6 @@ (function (global, factory) { if (typeof define === "function" && define.amd) { - define(['exports'], factory); + define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { @@ -10,50 +10,21 @@ factory(mod.exports); global.dhalsim = mod.exports; } -})(this, function (exports) { - 'use strict'; +})(this, function (_exports) { + "use strict"; - Object.defineProperty(exports, "__esModule", { + Object.defineProperty(_exports, "__esModule", { value: true }); + _exports["default"] = void 0; - var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; + function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var defaultDhalsimOptions = { breakingPointValue: '', @@ -62,7 +33,9 @@ wide: '1200px' }; - var Dhalsim = function () { + var Dhalsim = + /*#__PURE__*/ + function () { function Dhalsim(options) { _classCallCheck(this, Dhalsim); @@ -72,57 +45,54 @@ } _createClass(Dhalsim, [{ - key: 'init', + key: "init", value: function init() { this.renderCSS(); } }, { - key: 'renderCSS', + key: "renderCSS", value: function renderCSS() { - var css = '\n body:before {\n content: \'smartphone\';\n display: none;\n }\n\n @media (min-width: ' + this.tablet + ') {\n body:before {\n content: \'tablet\';\n }\n }\n\n @media (min-width: ' + this.desktop + ') {\n body:before {\n content: \'desktop\';\n }\n }\n\n @media (min-width: ' + this.wide + ') {\n body:before {\n content: \'wide\';\n }\n }\n '; - + var css = "\n body:before {\n content: 'smartphone';\n display: none;\n }\n\n @media (min-width: ".concat(this.tablet, ") {\n body:before {\n content: 'tablet';\n }\n }\n\n @media (min-width: ").concat(this.desktop, ") {\n body:before {\n content: 'desktop';\n }\n }\n\n @media (min-width: ").concat(this.wide, ") {\n body:before {\n content: 'wide';\n }\n }\n "); var head = document.getElementsByTagName('head')[0]; var style = document.createElement('style'); - style.type = 'text/css'; style.appendChild(document.createTextNode(css)); head.appendChild(style); } }, { - key: 'isMobile', + key: "isMobile", value: function isMobile() { return this.breakpoint === 'smartphone'; } }, { - key: 'isTablet', + key: "isTablet", value: function isTablet() { return this.breakpoint === 'tablet'; } }, { - key: 'isDesktop', + key: "isDesktop", value: function isDesktop() { return this.breakpoint === 'desktop'; } }, { - key: 'isWide', + key: "isWide", value: function isWide() { return this.breakpoint === 'wide'; } }, { - key: 'beyondTablet', + key: "beyondTablet", value: function beyondTablet() { return this.isDesktop() || this.isWide(); } }, { - key: 'beyondMobile', + key: "beyondMobile", value: function beyondMobile() { return this.isTablet() || this.beyondTablet(); } }, { - key: 'breakpoint', + key: "breakpoint", get: function get() { this.breakpointValue = window.getComputedStyle(this.body, ':before').getPropertyValue('content').replace(/"/g, ''); - return this.breakpointValue; } }]); @@ -130,5 +100,5 @@ return Dhalsim; }(); - exports.default = Dhalsim; + _exports["default"] = Dhalsim; }); \ No newline at end of file diff --git a/dist/dhalsim.min.js b/dist/dhalsim.min.js index 0ff5cfc..f3ef877 100644 --- a/dist/dhalsim.min.js +++ b/dist/dhalsim.min.js @@ -1 +1 @@ -(function(a,b){if('function'==typeof define&&define.amd)define(['exports'],b);else if('undefined'!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.dhalsim=c.exports}})(this,function(a){'use strict';function b(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(a,'__esModule',{value:!0});var c=Object.assign||function(a){for(var b,c=1;c