| 667 | } |
| 668 | |
| 669 | function buildRouterOptions (options, defaultOptions) { |
| 670 | const routerOptions = options.routerOptions == null |
| 671 | ? Object.create(null) |
| 672 | : Object.assign(Object.create(null), options.routerOptions) |
| 673 | |
| 674 | const usedDeprecatedOptions = routerKeys.filter(key => Object.hasOwn(options, key)) |
| 675 | |
| 676 | if (usedDeprecatedOptions.length > 0) { |
| 677 | FSTDEP022(usedDeprecatedOptions.join(class="st">', ')) |
| 678 | } |
| 679 | |
| 680 | for (const key of routerKeys) { |
| 681 | if (!Object.hasOwn(routerOptions, key)) { |
| 682 | routerOptions[key] = options[key] ?? defaultOptions[key] |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | return routerOptions |
| 687 | } |
| 688 | |
| 689 | /** |
| 690 | * Used within the route handler as a `net.Socket.close` event handler. |