@bblocks/compose
Version:
This library is a handy helper if you work with objects, inheritance and composition, like to code efficiently and need to support all modern browser and IE11 without transpiling.
1 lines • 2.3 kB
JavaScript
!function(e,t){if("function"==typeof define&&define.amd)define(["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var r={};t(r),e.compose=r}}(this,function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function t(){var e=arguments,t=e[0];if(null!=t){if(e.length<=1)return t;for(var r=1;r<e.length;r++){var n=e[r];"object"==(void 0===n?"undefined":o(n))?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):console.warn('Invalid parameter type "'+(void 0===n?"undefined":o(n))+'" for the argument #'+r)}return t}}function r(){var e=arguments;return null==e[0]&&(e[0]=Object.prototype),e[0]=Object.create(e[0],Object.getOwnPropertyDescriptors(e[0])),1==e.length?e[0]:t.apply(this,e)}if(!Object.hasOwnProperty("getOwnPropertyDescriptors")){var n=Object.hasOwnProperty("getOwnPropertySymbols");Object.defineProperty(Object,"getOwnPropertyDescriptors",{configurable:!0,writable:!0,value:function(r){var e=Object.getOwnPropertyNames(r);return n&&(e=e.concat(Object.getOwnPropertySymbols(r))),e.reduce(function(e,t){return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:Object.getOwnPropertyDescriptor(r,t)})},{})}})}if(!Object.assign){Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),c=0,f=i.length;c<f;c++){var p=i[c],l=Object.getOwnPropertyDescriptor(o,p);void 0!==l&&l.enumerable&&(r[p]=o[p])}}return r}})}var i={mix:function(){return Array.prototype.unshift.call(arguments,this),t.apply(this,arguments),this},clone:function(){return Array.prototype.unshift.call(arguments,this),r.apply(this,arguments)},define:function(){if(!arguments.length)return this;for(var e=0;e<arguments.length;e++)Object.defineProperties(this,arguments[e]);return this}},c=function(){Array.prototype.unshift.call(arguments,this),t.apply(this,arguments)};c.prototype=i,e.mix=t,e.clone=r,e.block=i,e.Block=c});