goliatone / gextend

Simple Object extend helper module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add shim/unshim helpers

goliatone opened this issue · comments

_extend.shim = function(obj) {
        var shim = function() {
            return obj;
        };
        shim.__shim = true;
        return shim;
    };

    _extend.unshim = function(obj) {
        for (var property in obj) {
            if (obj[property].__shim) {
                obj[property] = obj[property]();
            }
        }
    };