-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (33 loc) · 987 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports);
global.actual = mod.exports;
}
})(this, function (exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function loop(fn) {
var fnargs;
function recur() {
for(var _len = arguments.length, _key = 0; _key < _len; _key++)
fnargs[_key+2] = arguments[_key];
return fn.bind.apply(fn, fnargs)
};
return function() {
fnargs = [void 0, recur];
for(var result = recur.apply(void 0, arguments); result instanceof Function;)
result = result();
return result
}
}
exports.default = loop;
});