Browse Source

refactor: use spread operator for Nodev6+ support

pull/24/head
Deepak 6 years ago
committed by GitHub
parent
commit
5018623252
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/index.js

8
src/index.js

@ -53,12 +53,8 @@ const createTestServer = opts => createCert(opts && opts.certificate)
})
]);
app.get = function () {
// TODO: Use destructuring when targeting Node.js v6
const args = Array.from(arguments);
const path = args[0];
const fns = args.slice(1);
app.get = function (...args) {
const [path, fns] = args;
for (const fn of fns) {
get(path, send(fn));
}

Loading…
Cancel
Save