Fix commonjs import/export for patchRouterParam and make secret versioning/snapshots compatible with prev unversioned secrets

This commit is contained in:
Tuan Dang
2022-12-26 17:52:13 -05:00
parent 9f724b5ede
commit 0c6dfbe4b4
5 changed files with 67 additions and 49 deletions
+6 -2
View File
@@ -45,7 +45,7 @@ function wrap(fn) {
return copyFnProps(fn, newFn);
}
export function patchRouterParam() {
function patchRouterParam() {
const originalParam = Router.prototype.constructor.param;
Router.prototype.constructor.param = function param(name, fn) {
fn = wrap(fn);
@@ -62,4 +62,8 @@ Object.defineProperty(Layer.prototype, 'handle', {
fn = wrap(fn);
this.__handle = fn;
},
});
});
module.exports = {
patchRouterParam
};