๐Ÿ“ฆ ibakaidov / node-thunkoto

๐Ÿ“„ index.js ยท 15 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15var thunkify = require("thunkify");

module.exports =addProto;

function addProto(obj) {
    obj=obj==null?Function:obj;
    Object.defineProperty(obj.prototype,'thunkify', {
        enumerable: false,
        configurable: false,
        get: function () {
            return thunkify(this);
        }
    });
}