🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@fluojs/http

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluojs/http - npm Package Compare versions

Comparing version
1.0.0-beta.8
to
1.0.0-beta.9
+1
-1
dist/dispatch/dispatch-routing-policy.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"dispatch-routing-policy.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatch-routing-policy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAQ3G;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAOlH"}
{"version":3,"file":"dispatch-routing-policy.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatch-routing-policy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAQ3G;AA2BD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAsBlH"}

@@ -16,2 +16,21 @@ import { HandlerNotFoundError } from '../errors.js';

}
function defineRequestParams(request, params) {
Object.defineProperty(request, 'params', {
configurable: true,
enumerable: true,
value: params,
writable: true
});
}
function findInheritedParamsDescriptor(request) {
let prototype = Object.getPrototypeOf(request);
while (prototype) {
const descriptor = Object.getOwnPropertyDescriptor(prototype, 'params');
if (descriptor) {
return descriptor;
}
prototype = Object.getPrototypeOf(prototype);
}
return undefined;
}

@@ -25,8 +44,18 @@ /**

export function updateRequestParams(requestContext, params) {
Object.defineProperty(requestContext.request, 'params', {
configurable: true,
enumerable: true,
value: params,
writable: true
});
const request = requestContext.request;
const ownDescriptor = Object.getOwnPropertyDescriptor(request, 'params');
if (ownDescriptor) {
if ('value' in ownDescriptor && ownDescriptor.writable) {
request.params = params;
return;
}
defineRequestParams(request, params);
return;
}
const inheritedDescriptor = findInheritedParamsDescriptor(request);
if (!inheritedDescriptor || 'value' in inheritedDescriptor && inheritedDescriptor.writable) {
request.params = params;
return;
}
defineRequestParams(request, params);
}

@@ -13,3 +13,3 @@ {

],
"version": "1.0.0-beta.8",
"version": "1.0.0-beta.9",
"private": false,

@@ -46,4 +46,4 @@ "license": "MIT",

"@fluojs/core": "^1.0.0-beta.2",
"@fluojs/di": "^1.0.0-beta.5",
"@fluojs/validation": "^1.0.0-beta.1"
"@fluojs/validation": "^1.0.0-beta.1",
"@fluojs/di": "^1.0.0-beta.5"
},

@@ -50,0 +50,0 @@ "devDependencies": {