@@ -10,9 +10,8 @@ var transform = require('./transform');
10
10
11
11
// options can contain:
12
12
// collectionPrefix: the string to put in front of every collection name.
13
- function ExportAdapter ( mongoURI , options ) {
13
+ function ExportAdapter ( mongoURI , options = { } ) {
14
14
this . mongoURI = mongoURI ;
15
- options = options || { } ;
16
15
17
16
this . collectionPrefix = options . collectionPrefix ;
18
17
@@ -63,8 +62,7 @@ function returnsTrue() {
63
62
// Returns a promise for a schema object.
64
63
// If we are provided a acceptor, then we run it on the schema.
65
64
// If the schema isn't accepted, we reload it at most once.
66
- ExportAdapter . prototype . loadSchema = function ( acceptor ) {
67
- acceptor = acceptor || returnsTrue ;
65
+ ExportAdapter . prototype . loadSchema = function ( acceptor = returnsTrue ) {
68
66
69
67
if ( ! this . schemaPromise ) {
70
68
this . schemaPromise = this . collection ( '_SCHEMA' ) . then ( ( coll ) => {
@@ -277,8 +275,7 @@ ExportAdapter.prototype.removeRelation = function(key, fromClassName,
277
275
// acl: a list of strings. If the object to be updated has an ACL,
278
276
// one of the provided strings must provide the caller with
279
277
// write permissions.
280
- ExportAdapter . prototype . destroy = function ( className , query , options ) {
281
- options = options || { } ;
278
+ ExportAdapter . prototype . destroy = function ( className , query , options = { } ) {
282
279
var isMaster = ! ( 'acl' in options ) ;
283
280
var aclGroup = options . acl || [ ] ;
284
281
@@ -346,8 +343,7 @@ ExportAdapter.prototype.create = function(className, object, options) {
346
343
// This should only be used for testing - use 'find' for normal code
347
344
// to avoid Mongo-format dependencies.
348
345
// Returns a promise that resolves to a list of items.
349
- ExportAdapter . prototype . mongoFind = function ( className , query , options ) {
350
- options = options || { } ;
346
+ ExportAdapter . prototype . mongoFind = function ( className , query , options = { } ) {
351
347
return this . collection ( className ) . then ( ( coll ) => {
352
348
return coll . find ( query , options ) . toArray ( ) ;
353
349
} ) ;
@@ -503,8 +499,7 @@ ExportAdapter.prototype.smartFind = function(coll, where, options) {
503
499
// TODO: make userIds not needed here. The db adapter shouldn't know
504
500
// anything about users, ideally. Then, improve the format of the ACL
505
501
// arg to work like the others.
506
- ExportAdapter . prototype . find = function ( className , query , options ) {
507
- options = options || { } ;
502
+ ExportAdapter . prototype . find = function ( className , query , options = { } ) {
508
503
var mongoOptions = { } ;
509
504
if ( options . skip ) {
510
505
mongoOptions . skip = options . skip ;
0 commit comments