This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

12 lines
434 B
JavaScript
Raw Permalink Normal View History

2021-04-02 02:24:13 +03:00
var path = require('../internals/path');
var global = require('../internals/global');
var aFunction = function (variable) {
return typeof variable == 'function' ? variable : undefined;
};
module.exports = function (namespace, method) {
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
: path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
};