get-built-in.js 358 B

12345678910
  1. var global = require('../internals/global');
  2. var isCallable = require('../internals/is-callable');
  3. var aFunction = function (argument) {
  4. return isCallable(argument) ? argument : undefined;
  5. };
  6. module.exports = function (namespace, method) {
  7. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  8. };