diff --git a/lib/server.js b/lib/server.js index 30af2e3..fa0f828 100644 --- a/lib/server.js +++ b/lib/server.js @@ -47,15 +47,15 @@ function mergeFunctionArgs (argv, start, end) { const handlers = [] for (let i = start; i < end; i++) { - if (argv[i] instanceof Array) { + if (Array.isArray(argv[i])) { const arr = argv[i] for (let j = 0; j < arr.length; j++) { - if (!(arr[j] instanceof Function)) { + if ((typeof arr[j] !== 'function')) { throw new TypeError('Invalid argument type: ' + typeof (arr[j])) } handlers.push(arr[j]) } - } else if (argv[i] instanceof Function) { + } else if (typeof argv[i] === 'function') { handlers.push(argv[i]) } else { throw new TypeError('Invalid argument type: ' + typeof (argv[i]))