We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6133ce1 commit 94d4065Copy full SHA for 94d4065
src/Uwave.js
@@ -1,5 +1,6 @@
1
'use strict';
2
3
+const has = require('has');
4
const EventEmitter = require('events');
5
const { promisify } = require('util');
6
const mongoose = require('mongoose');
@@ -248,7 +249,10 @@ class UwaveServer extends EventEmitter {
248
249
throw new TypeError(`Source plugin should be a function, got ${typeof sourceFactory}`);
250
}
251
- if (typeof sourceFactory === 'function' && sourceFactory.api >= 3) {
252
+ if (typeof sourceFactory === 'function'
253
+ && has(sourceFactory, 'api')
254
+ && typeof sourceFactory.api === 'number'
255
+ && sourceFactory.api >= 3) {
256
throw new TypeError('uw.source() only supports old-style source plugins.');
257
258
0 commit comments