extend-with-super
Version:
Extend object literals with function properties to have a _super method that references the original function, instead of overwriting it. (No dependencies, but borrowed methods from underscore.js.)
1 lines • 1.57 kB
JavaScript
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.extendWithSuper=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){(function(a){"use strict";function c(a){var b=typeof a;return"function"===b||"object"===b&&!!a}function d(a){return"function"==typeof a||!1}function e(b,c){if(!this||this===a){var d=function(){this._super=c},e=new d;return function(){return b.apply(e,Array.prototype.slice.call(arguments))}}this._super=c;var f=this;return function(){return b.apply(f,Array.prototype.slice.call(arguments))}}function f(){var a=arguments[0];if(!a)return!1;if(!c(a))return a;for(var b,f,g=arguments.length,h=1;g>h;h++)if(b=arguments[h],c(b))for(f in b)Object.hasOwnProperty.call(b,f)&&(d(b[f])&&d(a[f])?(a[f]=e.apply(this,[b[f],a[f]]),a[f].prototype=b[f].prototype):a[f]=b[f]);return a}b.exports=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});