@financial-times/dotcom-middleware-navigation 9.0.0-beta.8 → 9.0.1

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.
@@ -1,2 +1,3 @@
1
- declare const _default: (request: any, response: any) => string;
1
+ import { Request, Response } from 'express';
2
+ declare const _default: (request: Request, response: Response) => string;
2
3
  export default _default;
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./navigation"), exports);
@@ -1,7 +1,8 @@
1
+ import { Request, Response, NextFunction } from 'express';
1
2
  import { TNavOptions } from '@financial-times/dotcom-server-navigation';
2
3
  declare type MiddlewareOptions = TNavOptions & {
3
4
  enableSubNavigation?: boolean;
4
5
  getCurrentPath?: Function;
5
6
  };
6
- export declare const init: (userOptions?: MiddlewareOptions) => (request: any, response: any, next: any) => Promise<void>;
7
+ export declare const init: (userOptions?: MiddlewareOptions) => (request: Request, response: Response, next: NextFunction) => Promise<void>;
7
8
  export {};
@@ -11,7 +11,7 @@ const defaultOptions = {
11
11
  enableSubNavigation: false,
12
12
  getCurrentPath: (request) => normalizePath_1.default(request.get('ft-vanity-url') || request.path)
13
13
  };
14
- exports.init = (userOptions = {}) => {
14
+ const init = (userOptions = {}) => {
15
15
  const options = { ...defaultOptions, ...userOptions };
16
16
  const navigation = new dotcom_server_navigation_1.Navigation(options);
17
17
  // Not all pages appear in the navigation so this request will fail often.
@@ -46,3 +46,4 @@ exports.init = (userOptions = {}) => {
46
46
  }
47
47
  };
48
48
  };
49
+ exports.init = init;