diff --git a/dist/vue-user-timeout.es5.js b/dist/vue-user-timeout.es5.js index c5807b3..9a50912 100644 --- a/dist/vue-user-timeout.es5.js +++ b/dist/vue-user-timeout.es5.js @@ -1,55 +1,71 @@ -function _typeof(obj) { - if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === 'function' && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; +"use strict"; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +!function (e) { + var t = {}; + + function n(r) { + if (t[r]) return t[r].exports; + var o = t[r] = { + i: r, + l: !1, + exports: {} }; + return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports; } - return _typeof(obj); -} - -const userTimeout = require('./lib/userTimeout'); -(function() { - /** - * Install plugin - * @param Vue - * @param options - */ - function plugin(Vue, axios) { - if (plugin.installed) { - return; + n.m = e, n.c = t, n.d = function (e, t, r) { + n.o(e, t) || Object.defineProperty(e, t, { + enumerable: !0, + get: r + }); + }, n.r = function (e) { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + }), Object.defineProperty(e, "__esModule", { + value: !0 + }); + }, n.t = function (e, t) { + if (1 & t && (e = n(e)), 8 & t) return e; + if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e; + var r = Object.create(null); + if (n.r(r), Object.defineProperty(r, "default", { + enumerable: !0, + value: e + }), 2 & t && "string" != typeof e) for (var o in e) { + n.d(r, o, function (t) { + return e[t]; + }.bind(null, o)); } + return r; + }, n.n = function (e) { + var t = e && e.__esModule ? function () { + return e["default"]; + } : function () { + return e; + }; + return n.d(t, "a", t), t; + }, n.o = function (e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }, n.p = "", n(n.s = 0); +}([function (e, t, n) { + var r = n(1); - plugin.installed = true; - Vue.$userTimeout = userTimeout; - Object.defineProperties(Vue.prototype, { + e.exports = function e(t, n) { + e.installed || (e.installed = !0, t.$userTimeout = r, Object.defineProperties(t.prototype, { $userTimeout: { get: function get() { - return userTimeout; - }, - }, - }); - } // Logic to determine how to include the plugin + return r; + } + } + })); + }; +}, function (e, t, n) { + "use strict"; - if ( - (typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) == - 'object' - ) { - module.exports = plugin; - } else if (typeof define === 'function' && define.amd) { - define([], function() { - return plugin; - }); - } else if (window.Vue && typeof window !== 'undefined') { - Vue.use(plugin, options); - } -})(); + n.r(t), t["default"] = { + test: "Test", + init: function init(e) {} + }; +}]); \ No newline at end of file diff --git a/dist/vue-user-timeout.min.es5.js b/dist/vue-user-timeout.min.es5.js index d1a37ef..b386ece 100644 --- a/dist/vue-user-timeout.min.es5.js +++ b/dist/vue-user-timeout.min.es5.js @@ -1,38 +1 @@ -function _typeof(e) { - return (_typeof = - typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' - ? function(e) { - return typeof e; - } - : function(e) { - return e && - typeof Symbol === 'function' && - e.constructor === Symbol && - e !== Symbol.prototype - ? 'symbol' - : typeof e; - })(e); -} -const userTimeout = require('./lib/userTimeout'); - -!(function() { - function e(t, o) { - e.installed || - ((e.installed = !0), - (t.$userTimeout = userTimeout), - Object.defineProperties(t.prototype, { - $userTimeout: { - get() { - return userTimeout; - }, - }, - })); - } - (typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) == 'object' - ? (module.exports = e) - : typeof define === 'function' && define.amd - ? define([], function() { - return e; - }) - : window.Vue && typeof window !== 'undefined' && Vue.use(e, options); -})(); +"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==_typeof(t)&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(o,r,function(e){return t[e]}.bind(null,r));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){var o=n(1);t.exports=function t(e,n){t.installed||(t.installed=!0,e.$userTimeout=o,Object.defineProperties(e.prototype,{$userTimeout:{get:function(){return o}}}))}},function(t,e,n){n.r(e),e.default={test:"Test",init:function(t){}}}]); \ No newline at end of file diff --git a/npmpublish.yml b/npmpublish.yml deleted file mode 100644 index ed81431..0000000 --- a/npmpublish.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Node.js Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm ci - - run: npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - publish-gpr: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://npm.pkg.github.com/ - scope: '@your-github-username' - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/src/index.js b/src/index.js index 59a54ad..932a2ab 100644 --- a/src/index.js +++ b/src/index.js @@ -1,17 +1,20 @@ const userTimeout = require('./lib/userTimeout'); +// eslint-disable-next-line func-names (function() { /** * Install plugin * @param Vue * @param options */ - function plugin(Vue, axios) { + // eslint-disable-next-line no-unused-vars + function plugin(Vue, options) { if (plugin.installed) { return; } - plugin.installed = true; + plugin.installed = true; + // eslint-disable-next-line no-param-reassign Vue.$userTimeout = userTimeout; Object.defineProperties(Vue.prototype, { @@ -26,11 +29,14 @@ const userTimeout = require('./lib/userTimeout'); // Logic to determine how to include the plugin if (typeof exports === 'object') { module.exports = plugin; + // eslint-disable-next-line no-undef } else if (typeof define === 'function' && define.amd) { + // eslint-disable-next-line no-undef, func-names define([], function() { return plugin; }); } else if (window.Vue && typeof window !== 'undefined') { + // eslint-disable-next-line no-undef Vue.use(plugin, options); } })(); diff --git a/src/lib/userTimeout.js b/src/lib/userTimeout.js index 99a0f76..96b3469 100644 --- a/src/lib/userTimeout.js +++ b/src/lib/userTimeout.js @@ -3,5 +3,9 @@ export default { test: 'Test', // methods - init: options => {}, + init: options => { + if (options) { + console.log('yay'); + } + }, };