如何改写成兼容amd和普通方式调用?

define("utils.ClassUtil", function () {
    /**
     * @summary 寄生组合式继承
     * @param subType 子类
     * @param superType 超类
     * @memberof ClassUtil
     */
    function inheritPrototype(subType, superType) {
        var prototype = object(superType.prototype);
        prototype.constructor = subType;
        subType.prototype = prototype;
    }
    /**
     * @summary 返回构造函数
     * @memberof ClassUtil
     */
    function object(o) {
        function F () {}
        F.prototype = o;
        return new F();
    }


    return {
        inheritPrototype:inheritPrototype
    }
});

(function (factory) {
    'use strict';
    if (typeof define === "function" && define.amd) {
        // AMD. Register as an anonymous module.
        define("utils.ClassUtil",[], factory);
    } else {
        // Browser globals
        factory(this.jQuery);
    }
}).call(this, function ($) {
    /**
     * @summary 寄生组合式继承
     * @param subType 子类
     * @param superType 超类
     * @memberof ClassUtil
     */
    function inheritPrototype(subType, superType) {
        var prototype = object(superType.prototype);
        prototype.constructor = subType;
        subType.prototype = prototype;
    }
    /**
     * @summary 返回构造函数
     * @memberof ClassUtil
     */
    function object(o) {
        function F() { }
        F.prototype = o;
        return new F();
    }
    var exports = {
        inheritPrototype: inheritPrototype
    }
    this.utils = this.utils || {};
    this.utils.ClassUtil = exports;
    return exports;
});

可以去了解下umd规范 http://web.jobbole.com/82238/