sjl.js
function normalizeArgsForDefineSubClass (superClass, constructor, methods, statics) {
        superClass = superClass || Object.create(Object.prototype);

        // Snatched statics
        var _statics;

        // Should extract statics?
        if (isFunction(superClass)) {
            // Extract statics
            _statics = Object.keys(superClass).reduce(function (agg, key) {
                if (key === 'extend' || key === 'extendWith') { return agg; }
                agg[key] = superClass[key];
                return agg;
            }, {});
        }

        // Re-arrange args if constructor is object
        if (isObject(constructor)) {
            statics = methods;
            methods = clone(constructor);
            constructor = ! isFunction(methods.constructor) ? standInConstructor(superClass) : methods.constructor;
            unset(methods, 'constructor');
        }

        // Ensure constructor
        constructor = isset(constructor) ? constructor : standInConstructor(superClass);

        // Returned normalized args
        return {
            constructor: constructor,
            methods: methods,
            statics: extend(_statics || {}, statics || {}, true),
            superClass: superClass
        };
    }
function normalizeArgsForDefineSubClass (superClass, constructor, methods, statics) {
        superClass = superClass || Object.create(Object.prototype);

        // Snatched statics
        var _statics;

        // Should extract statics?
        if (isFunction(superClass)) {
            // Extract statics
            _statics = Object.keys(superClass).reduce(function (agg, key) {
                if (key === 'extend' || key === 'extendWith') { return agg; }
                agg[key] = superClass[key];
                return agg;
            }, {});
        }

        // Re-arrange args if constructor is object
        if (isObject(constructor)) {
            statics = methods;
            methods = clone(constructor);
            constructor = ! isFunction(methods.constructor) ? standInConstructor(superClass) : methods.constructor;
            unset(methods, 'constructor');
        }

        // Ensure constructor
        constructor = isset(constructor) ? constructor : standInConstructor(superClass);

        // Returned normalized args
        return {
            constructor: constructor,
            methods: methods,
            statics: extend(_statics || {}, statics || {}, true),
            superClass: superClass
        };
    }
function normalizeArgsForDefineSubClass ( superClass , constructor , methods , statics ) { superClass = superClass || Object . create ( Object . prototype ) ; // Snatched statics var _statics ; // Should extract statics? if ( isFunction ( superClass ) ) { // Extract statics _statics = Object . keys ( superClass ) . reduce ( function ( agg , key ) { if ( key === 'extend' || key === 'extendWith' ) { return agg ; } agg [ key ] = superClass [ key ] ; return agg ; } , { } ) ; } // Re-arrange args if constructor is object if ( isObject ( constructor ) ) { statics = methods ; methods = clone ( constructor ) ; constructor = ! isFunction ( methods . constructor ) ? standInConstructor ( superClass ) : methods . constructor ; unset ( methods , 'constructor' ) ; } // Ensure constructor constructor = isset ( constructor ) ? constructor : standInConstructor ( superClass ) ; // Returned normalized args return { constructor : constructor , methods : methods , statics : extend ( _statics || { } , statics || { } , true ) , superClass : superClass } ; }
Normalized the parameters required for `defineSubClassPure` and `defineSubClass` to operate.
@param superClass {Function} - Superclass to inherit from.
@param constructor {Function|Object} - Required.  Note:  If this param is an object, then other params shift over by 1 (`methods` becomes `statics` and this param becomes `methods` (constructor key expected else empty stand in constructor is used).
@param methods {Object|undefined} - Methods for prototype.  Optional.  Note:  If `constructor` param is an object, this param takes the place of the `statics` param.
@param statics {Object|undefined} - Constructor's static methods.  Optional.  Note:  If `constructor` param is an object, this param is not used.
@returns {{constructor: (Function|*), methods: *, statics: *, superClass: (*|Object)}}
Normalized the parameters required for defineSubClassPure and defineSubClass to operate .