Skip to content

Commit 51a5953

Browse files
Allow db to be inspected and not fail weirdly
1 parent c702ccb commit 51a5953

File tree

2 files changed

+73
-70
lines changed

2 files changed

+73
-70
lines changed

lib/db.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ const db = new Proxy(
55
{},
66
{
77
get: function(obj, prop) {
8+
if (typeof prop === 'symbol') {
9+
return obj[prop];
10+
}
11+
812
const collection = Mongo.Collection.get(prop);
913

1014
if (!collection) {
11-
Meteor.isDevelopment &&
12-
console.warn(`There is no collection with the name: "${prop}"`);
15+
return obj[prop];
1316
}
1417

1518
return collection;

package.js

+68-68
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
Package.describe({
2-
name: 'cultofcoders:grapher',
3-
version: '1.3.7',
4-
// Brief, one-line summary of the package.
5-
summary: 'Grapher is a data fetching layer on top of Meteor',
6-
// URL to the Git repository containing the source code for this package.
7-
git: 'https://github.com/cult-of-coders/grapher',
8-
// By default, Meteor will default to using README.md for documentation.
9-
// To avoid submitting documentation, set this field to null.
10-
documentation: 'README.md',
2+
name: 'cultofcoders:grapher',
3+
version: '1.3.7_1',
4+
// Brief, one-line summary of the package.
5+
summary: 'Grapher is a data fetching layer on top of Meteor',
6+
// URL to the Git repository containing the source code for this package.
7+
git: 'https://github.com/cult-of-coders/grapher',
8+
// By default, Meteor will default to using README.md for documentation.
9+
// To avoid submitting documentation, set this field to null.
10+
documentation: 'README.md',
1111
});
1212

1313
Npm.depends({
14-
sift: '3.2.6',
15-
'dot-object': '1.5.4',
16-
'lodash.clonedeep': '4.5.0',
17-
'deep-extend': '0.5.0',
14+
sift: '3.2.6',
15+
'dot-object': '1.5.4',
16+
'lodash.clonedeep': '4.5.0',
17+
'deep-extend': '0.5.0',
1818
});
1919

2020
Package.onUse(function(api) {
21-
api.versionsFrom('1.3');
22-
23-
var packages = [
24-
'ecmascript',
25-
'underscore',
26-
'promise',
27-
'check',
28-
'reactive-var',
29-
'mongo',
30-
31-
'reywood:[email protected]',
32-
'dburles:[email protected]',
33-
'herteby:[email protected]',
34-
];
35-
36-
api.use(packages);
37-
38-
api.mainModule('main.client.js', 'client');
39-
api.mainModule('main.server.js', 'server');
21+
api.versionsFrom('1.3');
22+
23+
var packages = [
24+
'ecmascript',
25+
'underscore',
26+
'promise',
27+
'check',
28+
'reactive-var',
29+
'mongo',
30+
31+
'reywood:[email protected]',
32+
'dburles:[email protected]',
33+
'herteby:[email protected]',
34+
];
35+
36+
api.use(packages);
37+
38+
api.mainModule('main.client.js', 'client');
39+
api.mainModule('main.server.js', 'server');
4040
});
4141

4242
Package.onTest(function(api) {
43-
api.use('cultofcoders:grapher');
43+
api.use('cultofcoders:grapher');
4444

45-
var packages = [
46-
'ecmascript',
47-
'underscore',
48-
49-
'reywood:[email protected]',
50-
'dburles:[email protected]',
51-
'herteby:[email protected]',
52-
'mongo',
53-
];
45+
var packages = [
46+
'ecmascript',
47+
'underscore',
48+
49+
'reywood:[email protected]',
50+
'dburles:[email protected]',
51+
'herteby:[email protected]',
52+
'mongo',
53+
];
5454

55-
api.use(packages);
56-
api.use('tracker');
55+
api.use(packages);
56+
api.use('tracker');
5757

58-
api.use(['cultofcoders:mocha', 'practicalmeteor:chai']);
58+
api.use(['cultofcoders:mocha', 'practicalmeteor:chai']);
5959

60-
// LINKS
61-
api.addFiles('lib/links/tests/main.js', 'server');
60+
// LINKS
61+
api.addFiles('lib/links/tests/main.js', 'server');
6262

63-
// EXPOSURE
64-
api.addFiles('lib/exposure/testing/server.js', 'server');
65-
api.addFiles('lib/exposure/testing/client.js', 'client');
63+
// EXPOSURE
64+
api.addFiles('lib/exposure/testing/server.js', 'server');
65+
api.addFiles('lib/exposure/testing/client.js', 'client');
6666

67-
// QUERY
68-
api.addFiles('lib/query/testing/bootstrap/index.js');
67+
// QUERY
68+
api.addFiles('lib/query/testing/bootstrap/index.js');
6969

70-
// When you play with tests you should comment this to make tests go faster.
71-
api.addFiles('lib/query/testing/bootstrap/fixtures.js', 'server');
70+
// When you play with tests you should comment this to make tests go faster.
71+
api.addFiles('lib/query/testing/bootstrap/fixtures.js', 'server');
7272

73-
api.addFiles('lib/query/testing/server.test.js', 'server');
74-
api.addFiles('lib/query/testing/client.test.js', 'client');
73+
api.addFiles('lib/query/testing/server.test.js', 'server');
74+
api.addFiles('lib/query/testing/client.test.js', 'client');
7575

76-
// NAMED QUERY
77-
api.addFiles('lib/namedQuery/testing/bootstrap/both.js');
78-
api.addFiles('lib/namedQuery/testing/bootstrap/client.js', 'client');
79-
api.addFiles('lib/namedQuery/testing/bootstrap/server.js', 'server');
76+
// NAMED QUERY
77+
api.addFiles('lib/namedQuery/testing/bootstrap/both.js');
78+
api.addFiles('lib/namedQuery/testing/bootstrap/client.js', 'client');
79+
api.addFiles('lib/namedQuery/testing/bootstrap/server.js', 'server');
8080

81-
// REACTIVE COUNTS
82-
api.addFiles('lib/query/counts/testing/server.test.js', 'server');
83-
api.addFiles('lib/query/counts/testing/client.test.js', 'client');
81+
// REACTIVE COUNTS
82+
api.addFiles('lib/query/counts/testing/server.test.js', 'server');
83+
api.addFiles('lib/query/counts/testing/client.test.js', 'client');
8484

85-
// NAMED QUERIES
86-
api.addFiles('lib/namedQuery/testing/server.test.js', 'server');
87-
api.addFiles('lib/namedQuery/testing/client.test.js', 'client');
85+
// NAMED QUERIES
86+
api.addFiles('lib/namedQuery/testing/server.test.js', 'server');
87+
api.addFiles('lib/namedQuery/testing/client.test.js', 'client');
8888

89-
// GRAPHQL
90-
api.addFiles('lib/graphql/testing/index.js', 'server');
89+
// GRAPHQL
90+
api.addFiles('lib/graphql/testing/index.js', 'server');
9191
});

0 commit comments

Comments
 (0)