1 | var cache;
|
2 |
|
3 | module.exports = function(config) {
|
4 | config = config || cache;
|
5 | if (typeof config !== 'object') throw new TypeError('application not configured');
|
6 | if (checkString(config.PostgresURL)) throw new TypeError('PostgresURL must be a non-empty string');
|
7 | cache = config;
|
8 | return cache;
|
9 | };
|
10 |
|
11 | function checkString(str) {
|
12 | return typeof str !== 'string' || !str.length;
|
13 | } |
\ | No newline at end of file |