Skip to content

Commit

Permalink
Update dependencies and fix vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
williamcosta committed May 7, 2019
1 parent 11d876e commit d4e80a6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 56 deletions.
76 changes: 23 additions & 53 deletions dist/dhalsim.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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: '',
Expand All @@ -62,7 +33,9 @@
wide: '1200px'
};

var Dhalsim = function () {
var Dhalsim =
/*#__PURE__*/
function () {
function Dhalsim(options) {
_classCallCheck(this, Dhalsim);

Expand All @@ -72,63 +45,60 @@
}

_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;
}
}]);

return Dhalsim;
}();

exports.default = Dhalsim;
_exports["default"] = Dhalsim;
});
2 changes: 1 addition & 1 deletion dist/dhalsim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dhalsim-js",
"version": "2.1.0",
"version": "2.1.1",
"description": "Media Query helper to check breakpoints via JavaScript",
"main": "dist/dhalsim.js",
"repository": {
Expand Down

0 comments on commit d4e80a6

Please sign in to comment.