main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
493 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | var path = require('../internals/path');
|
---|
| 3 | var global = require('../internals/global');
|
---|
| 4 | var isCallable = require('../internals/is-callable');
|
---|
| 5 |
|
---|
| 6 | var aFunction = function (variable) {
|
---|
| 7 | return isCallable(variable) ? variable : undefined;
|
---|
| 8 | };
|
---|
| 9 |
|
---|
| 10 | module.exports = function (namespace, method) {
|
---|
| 11 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
---|
| 12 | : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
---|
| 13 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.