From 6baeade4c0a2e2ce6c6eee28f5d8b71be5a06dd3 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 11 Dec 2019 13:07:48 +0100 Subject: [PATCH] fix documentation --- index.js | 9 ++++++++- test/main.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5d952c6..09233cf 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,19 @@ const fs = require('fs'); const path = require('path'); +/** + * @typedef {Object} options + * @property {any} [opts] object to pass to the handlers + * @property {string} [subdir] subdirectory for all requests + * @property {boolean} [verbose] enable verbose logging + */ + /** * Load all request handlers in the given folder * * @param {any} app express app * @param {string} modulefolder folder that contains all modules - * @param {{opts: any, subdir: string, verbose: boolean}} options + * @param {options} options */ module.exports = function ( app, diff --git a/test/main.js b/test/main.js index 7482803..05140af 100644 --- a/test/main.js +++ b/test/main.js @@ -63,7 +63,7 @@ describe('requestor', () => { }); it('should build requests with subdirectory', () => { - requestor(mock, './test/sub', {}, 'test'); + requestor(mock, './test/sub', { subdir: 'test' }); expect(mock.registered).to.have.all.keys([ 'post-/test/sub/', 'get-/test/sub/',