UNPKG

@ylz/plugins

Version:

ylz plugins

3 lines (2 loc) 1.09 kB
/* * Copyright © 2019-2019 chenwenbin * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self)["dash-event"]=e()}(this,(function(){"use strict";function t(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var e={},n=Object.create(null),r=Object.create(null);var o,c=/\B([A-Z])/g,a=(o=function(t){return t.replace(c,"-$1").toLowerCase()},function(t){return n[t]||(n[t]=o(t))});return e.install=function(e){var o=e.prototype.$emit;e.prototype.$emit=function(){var e=Array.prototype.slice.call(arguments),i=e[0],l=e.splice(1);r[i]||!n[i]&&!c.test(i)?(r[i]=i,o.call.apply(o,[this,i].concat(t(l)))):(o.call.apply(o,[this,i].concat(t(l))),o.call.apply(o,[this,a(i)].concat(t(l))))}},e}));