@dhyasama/totem-models 12.8.0 → 12.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var mongooseLeanVirtuals = require('mongoose-lean-virtuals');
4
+
3
5
  var bootstrap = function(mongoose, config) {
4
6
 
5
7
  var env = process.env.NODE_ENV || 'development';
@@ -8,6 +10,8 @@ var bootstrap = function(mongoose, config) {
8
10
  //https://mongoosejs.com/docs/migrating_to_5.html#id-getter
9
11
  mongoose.set("objectIdGetter", false);
10
12
 
13
+ mongoose.plugin(mongooseLeanVirtuals);
14
+
11
15
  // turn on debug if in development and not explicitly turned off
12
16
  mongoose.set("debug", (!config.suppressDebugLog && env == "development"));//mongoose.set('debug',true);
13
17
 
package/lib/Account.js CHANGED
@@ -132,7 +132,7 @@ module.exports = function(mongoose, config) {
132
132
  }
133
133
  };
134
134
 
135
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
135
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
136
136
  else { return run(); }
137
137
 
138
138
  };
@@ -159,7 +159,7 @@ module.exports = function(mongoose, config) {
159
159
  return accounts;
160
160
  };
161
161
 
162
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
162
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
163
163
  else { return run(); }
164
164
 
165
165
  };
@@ -203,7 +203,7 @@ module.exports = function(mongoose, config) {
203
203
  }
204
204
  };
205
205
 
206
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
206
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
207
207
  else { return run(); }
208
208
 
209
209
  };
@@ -220,7 +220,7 @@ module.exports = function(mongoose, config) {
220
220
  return result;
221
221
  };
222
222
 
223
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
223
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
224
224
  else { return run(); }
225
225
 
226
226
  };
@@ -237,7 +237,7 @@ module.exports = function(mongoose, config) {
237
237
  return res;
238
238
  };
239
239
 
240
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
240
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
241
241
  else { return run(); }
242
242
 
243
243
  };
@@ -253,7 +253,7 @@ module.exports = function(mongoose, config) {
253
253
  return res;
254
254
  };
255
255
 
256
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
256
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
257
257
  else { return run(); }
258
258
 
259
259
  };
@@ -265,7 +265,7 @@ module.exports = function(mongoose, config) {
265
265
  return result;
266
266
  };
267
267
 
268
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
268
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
269
269
  else { return run(); }
270
270
 
271
271
  };
@@ -283,7 +283,7 @@ module.exports = function(mongoose, config) {
283
283
  return result;
284
284
  };
285
285
 
286
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
286
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
287
287
  else { return run(); }
288
288
 
289
289
  };
@@ -302,7 +302,7 @@ module.exports = function(mongoose, config) {
302
302
  return result;
303
303
  };
304
304
 
305
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
305
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
306
306
  else { return run(); }
307
307
 
308
308
  };
@@ -318,7 +318,7 @@ module.exports = function(mongoose, config) {
318
318
  return result;
319
319
  };
320
320
 
321
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
321
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
322
322
  else { return run(); }
323
323
 
324
324
  };
@@ -342,7 +342,7 @@ module.exports = function(mongoose, config) {
342
342
  return result;
343
343
  };
344
344
 
345
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
345
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
346
346
  else { return run(); }
347
347
 
348
348
  };
@@ -366,7 +366,7 @@ module.exports = function(mongoose, config) {
366
366
  return result;
367
367
  };
368
368
 
369
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
369
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
370
370
  else { return run(); }
371
371
 
372
372
  };
@@ -381,7 +381,7 @@ module.exports = function(mongoose, config) {
381
381
  return result;
382
382
  };
383
383
 
384
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
384
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
385
385
  else { return run(); }
386
386
 
387
387
  };
@@ -399,7 +399,7 @@ module.exports = function(mongoose, config) {
399
399
  return result;
400
400
  };
401
401
 
402
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
402
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
403
403
  else { return run(); }
404
404
 
405
405
  };
package/lib/Activity.js CHANGED
@@ -90,7 +90,7 @@ module.exports = function(mongoose, config) {
90
90
  return result;
91
91
  };
92
92
 
93
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
93
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
94
94
  else { return run(); }
95
95
 
96
96
  };
@@ -106,7 +106,7 @@ module.exports = function(mongoose, config) {
106
106
  return result;
107
107
  };
108
108
 
109
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
109
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
110
110
  else { return run(); }
111
111
 
112
112
  };
package/lib/ApiKey.js CHANGED
@@ -27,7 +27,7 @@ module.exports = function(mongoose, config) {
27
27
  return result;
28
28
  };
29
29
 
30
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
30
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
31
31
  else { return run(); }
32
32
 
33
33
  };
@@ -42,7 +42,7 @@ module.exports = function(mongoose, config) {
42
42
  return result;
43
43
  };
44
44
 
45
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
45
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
46
46
  else { return run(); }
47
47
 
48
48
  };
@@ -59,7 +59,7 @@ module.exports = function(mongoose, config) {
59
59
  return result;
60
60
  };
61
61
 
62
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
62
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
63
63
  else { return run(); }
64
64
 
65
65
  };
@@ -59,7 +59,7 @@ module.exports = function(mongoose, config) {
59
59
  return result;
60
60
  };
61
61
 
62
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
62
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
63
63
  else { return run(); }
64
64
 
65
65
  };
@@ -71,7 +71,7 @@ module.exports = function(mongoose, config) {
71
71
  return result;
72
72
  };
73
73
 
74
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
74
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
75
75
  else { return run(); }
76
76
 
77
77
  };
@@ -83,7 +83,7 @@ module.exports = function(mongoose, config) {
83
83
  return result;
84
84
  };
85
85
 
86
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
86
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
87
87
  else { return run(); }
88
88
 
89
89
  };
@@ -95,7 +95,7 @@ module.exports = function(mongoose, config) {
95
95
  return result;
96
96
  };
97
97
 
98
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
98
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
99
99
  else { return run(); }
100
100
 
101
101
  };
@@ -107,7 +107,7 @@ module.exports = function(mongoose, config) {
107
107
  return result;
108
108
  };
109
109
 
110
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
110
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
111
111
  else { return run(); }
112
112
 
113
113
  };
@@ -122,7 +122,7 @@ module.exports = function(mongoose, config) {
122
122
  return result;
123
123
  };
124
124
 
125
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
125
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
126
126
  else { return run(); }
127
127
 
128
128
  };
@@ -134,7 +134,7 @@ module.exports = function(mongoose, config) {
134
134
  return result;
135
135
  };
136
136
 
137
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
137
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
138
138
  else { return run(); }
139
139
 
140
140
  };
@@ -146,7 +146,7 @@ module.exports = function(mongoose, config) {
146
146
  return result;
147
147
  };
148
148
 
149
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
149
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
150
150
  else { return run(); }
151
151
 
152
152
  };
@@ -158,7 +158,7 @@ module.exports = function(mongoose, config) {
158
158
  return result;
159
159
  };
160
160
 
161
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
161
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
162
162
  else { return run(); }
163
163
 
164
164
  };
@@ -170,7 +170,7 @@ module.exports = function(mongoose, config) {
170
170
  return result;
171
171
  };
172
172
 
173
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
173
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
174
174
  else { return run(); }
175
175
 
176
176
  };
@@ -182,7 +182,7 @@ module.exports = function(mongoose, config) {
182
182
  return result;
183
183
  };
184
184
 
185
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
185
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
186
186
  else { return run(); }
187
187
 
188
188
  };
@@ -194,7 +194,7 @@ module.exports = function(mongoose, config) {
194
194
  return result;
195
195
  };
196
196
 
197
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
197
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
198
198
  else { return run(); }
199
199
 
200
200
  };
@@ -210,7 +210,7 @@ module.exports = function(mongoose, config) {
210
210
  return result;
211
211
  };
212
212
 
213
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
213
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
214
214
  else { return run(); }
215
215
 
216
216
  };
@@ -248,7 +248,7 @@ module.exports = function(mongoose, config) {
248
248
  return result;
249
249
  };
250
250
 
251
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
251
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
252
252
  else { return run(); }
253
253
 
254
254
  };
package/lib/CapTable.js CHANGED
@@ -167,7 +167,7 @@ module.exports = function(mongoose, config) {
167
167
  return result;
168
168
  };
169
169
 
170
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
170
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
171
171
  else { return run(); }
172
172
 
173
173
  };
@@ -183,7 +183,7 @@ module.exports = function(mongoose, config) {
183
183
  return result;
184
184
  };
185
185
 
186
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
186
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
187
187
  else { return run(); }
188
188
 
189
189
  };
@@ -225,7 +225,7 @@ module.exports = function(mongoose, config) {
225
225
  return result;
226
226
  };
227
227
 
228
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
228
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
229
229
  else { return run(); }
230
230
 
231
231
  };
@@ -263,7 +263,7 @@ module.exports = function(mongoose, config) {
263
263
  return result;
264
264
  };
265
265
 
266
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
266
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
267
267
  else { return run(); }
268
268
 
269
269
  };
@@ -300,7 +300,7 @@ module.exports = function(mongoose, config) {
300
300
  return result;
301
301
  };
302
302
 
303
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
303
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
304
304
  else { return run(); }
305
305
 
306
306
  };
@@ -338,7 +338,7 @@ module.exports = function(mongoose, config) {
338
338
  return result;
339
339
  };
340
340
 
341
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
341
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
342
342
  else { return run(); }
343
343
 
344
344
  };
@@ -376,7 +376,7 @@ module.exports = function(mongoose, config) {
376
376
  return result;
377
377
  };
378
378
 
379
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
379
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
380
380
  else { return run(); }
381
381
 
382
382
  };
@@ -406,7 +406,7 @@ module.exports = function(mongoose, config) {
406
406
  return result;
407
407
  };
408
408
 
409
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
409
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
410
410
  else { return run(); }
411
411
 
412
412
  };
@@ -493,7 +493,7 @@ module.exports = function(mongoose, config) {
493
493
  return result;
494
494
  };
495
495
 
496
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
496
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
497
497
  else { return run(); }
498
498
 
499
499
  };
@@ -510,7 +510,7 @@ module.exports = function(mongoose, config) {
510
510
  return await this.findByIdAndUpdate(_id, update, { new: true });
511
511
  };
512
512
 
513
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
513
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
514
514
  else { return run(); }
515
515
 
516
516
  };
@@ -522,7 +522,7 @@ module.exports = function(mongoose, config) {
522
522
  return result;
523
523
  };
524
524
 
525
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
525
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
526
526
  else { return run(); }
527
527
 
528
528
  };
package/lib/Deal.js CHANGED
@@ -137,7 +137,7 @@ module.exports = function(mongoose, config) {
137
137
  return deal;
138
138
  };
139
139
 
140
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
140
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
141
141
  else { return run(); }
142
142
 
143
143
  };
@@ -164,7 +164,7 @@ module.exports = function(mongoose, config) {
164
164
  return result;
165
165
  };
166
166
 
167
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
167
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
168
168
  else { return run(); }
169
169
 
170
170
  };
@@ -190,7 +190,7 @@ module.exports = function(mongoose, config) {
190
190
  return result;
191
191
  };
192
192
 
193
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
193
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
194
194
  else { return run(); }
195
195
 
196
196
  };
@@ -232,7 +232,7 @@ module.exports = function(mongoose, config) {
232
232
  return result;
233
233
  };
234
234
 
235
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
235
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
236
236
  else { return run(); }
237
237
 
238
238
  };
@@ -259,7 +259,7 @@ module.exports = function(mongoose, config) {
259
259
  return result;
260
260
  };
261
261
 
262
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
262
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
263
263
  else { return run(); }
264
264
 
265
265
  };
@@ -460,7 +460,7 @@ module.exports = function(mongoose, config) {
460
460
  return results;
461
461
  };
462
462
 
463
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
463
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
464
464
  else { return run(); }
465
465
 
466
466
  }
@@ -486,7 +486,7 @@ module.exports = function(mongoose, config) {
486
486
  return result;
487
487
  };
488
488
 
489
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
489
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
490
490
  else { return run(); }
491
491
 
492
492
  };
@@ -509,7 +509,7 @@ module.exports = function(mongoose, config) {
509
509
  return result;
510
510
  };
511
511
 
512
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
512
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
513
513
  else { return run(); }
514
514
 
515
515
  };
@@ -537,7 +537,7 @@ module.exports = function(mongoose, config) {
537
537
  return result;
538
538
  };
539
539
 
540
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
540
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
541
541
  else { return run(); }
542
542
 
543
543
  };
@@ -556,7 +556,7 @@ module.exports = function(mongoose, config) {
556
556
  return result;
557
557
  };
558
558
 
559
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
559
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
560
560
  else { return run(); }
561
561
 
562
562
  };
@@ -586,7 +586,7 @@ module.exports = function(mongoose, config) {
586
586
  return result;
587
587
  };
588
588
 
589
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
589
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
590
590
  else { return run(); }
591
591
 
592
592
  };
@@ -710,7 +710,7 @@ module.exports = function(mongoose, config) {
710
710
  return historyResult;
711
711
  };
712
712
 
713
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
713
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
714
714
  else { return run(); }
715
715
 
716
716
  };
@@ -750,7 +750,7 @@ module.exports = function(mongoose, config) {
750
750
  return result;
751
751
  };
752
752
 
753
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
753
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
754
754
  else { return run(); }
755
755
 
756
756
  };
@@ -840,7 +840,7 @@ module.exports = function(mongoose, config) {
840
840
  return await this.findByIdAndUpdate(_id, update, { new: true });
841
841
  };
842
842
 
843
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
843
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
844
844
  else { return run(); }
845
845
 
846
846
  };
@@ -35,7 +35,7 @@ module.exports = function(mongoose, config) {
35
35
  return result;
36
36
  };
37
37
 
38
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
38
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
39
39
  else { return run(); }
40
40
 
41
41
  };
@@ -52,7 +52,7 @@ module.exports = function(mongoose, config) {
52
52
  return result;
53
53
  };
54
54
 
55
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
55
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
56
56
  else { return run(); }
57
57
 
58
58
  };
@@ -69,7 +69,7 @@ module.exports = function(mongoose, config) {
69
69
  return await this.findByIdAndUpdate(_id, update, { new: true });
70
70
  };
71
71
 
72
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
72
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
73
73
  else { return run(); }
74
74
 
75
75
  };
@@ -34,7 +34,7 @@ module.exports = function(mongoose, config) {
34
34
  return result;
35
35
  };
36
36
 
37
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
37
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
38
38
  else { return run(); }
39
39
 
40
40
  };
@@ -51,7 +51,7 @@ module.exports = function(mongoose, config) {
51
51
  return result;
52
52
  };
53
53
 
54
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
54
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
55
55
  else { return run(); }
56
56
 
57
57
  };
@@ -68,7 +68,7 @@ module.exports = function(mongoose, config) {
68
68
  return await this.findByIdAndUpdate(_id, update, { new: true });
69
69
  };
70
70
 
71
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
71
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
72
72
  else { return run(); }
73
73
 
74
74
  };
package/lib/Document.js CHANGED
@@ -126,7 +126,7 @@ module.exports = function(mongoose, config) {
126
126
  };
127
127
  };
128
128
 
129
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
129
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
130
130
  else { return run(); }
131
131
 
132
132
  };
@@ -156,7 +156,7 @@ module.exports = function(mongoose, config) {
156
156
  return doc;
157
157
  };
158
158
 
159
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
159
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
160
160
  else { return run(); }
161
161
 
162
162
  };
@@ -185,7 +185,7 @@ module.exports = function(mongoose, config) {
185
185
  return result;
186
186
  };
187
187
 
188
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
188
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
189
189
  else { return run(); }
190
190
 
191
191
  };
@@ -205,7 +205,7 @@ module.exports = function(mongoose, config) {
205
205
  return result;
206
206
  };
207
207
 
208
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
208
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
209
209
  else { return run(); }
210
210
 
211
211
  };
@@ -233,7 +233,7 @@ module.exports = function(mongoose, config) {
233
233
  return result;
234
234
  };
235
235
 
236
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
236
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
237
237
  else { return run(); }
238
238
 
239
239
  };
@@ -263,7 +263,7 @@ module.exports = function(mongoose, config) {
263
263
  return result;
264
264
  };
265
265
 
266
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
266
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
267
267
  else { return run(); }
268
268
 
269
269
  };
@@ -282,7 +282,7 @@ module.exports = function(mongoose, config) {
282
282
  return await this.findByIdAndUpdate(_id, update, { new: true });
283
283
  };
284
284
 
285
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
285
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
286
286
  else { return run(); }
287
287
 
288
288
  };