Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
'use strict';
module.exports = function (fn) {
return function (id) {
var mod;
return function () {
if (!arguments.length) {
mod = lazy(mod, fn, id);
return mod;
}
var ret = {};
[].forEach.call(arguments, function (prop) {
Object.defineProperty(ret, prop, {
get: function () {
mod = lazy(mod, fn, id);
if (typeof mod[prop] === 'function') {
return function () {
return mod[prop].apply(mod, arguments);
};
}
return mod[prop];
}
});
});
return ret;
};
};
function lazy(mod, fn, id) {
return mod !== undefined ? mod : fn(id);
}
};