RESTful HTTP client library with composable interceptor architecture for Node.js and browsers
76
{
"context": "This criteria evaluates how well the engineer uses the rest.js package's advanced interceptor features, specifically the ComplexRequest pattern, to implement request deduplication. The focus is on proper use of the interceptor architecture, ComplexRequest for returning cached responses, and correct request lifecycle management.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses interceptor function",
"description": "Uses the `require('rest/interceptor')` function to create a custom interceptor with proper handler structure",
"max_score": 20
},
{
"name": "Uses ComplexRequest pattern",
"description": "Uses the `ComplexRequest` constructor (from 'rest/interceptor') to return cached responses for duplicate requests, passing an object with a `response` property containing the cached promise",
"max_score": 30
},
{
"name": "Implements request handler",
"description": "Implements the `request` handler function in the interceptor to intercept and check for duplicate requests before they are sent",
"max_score": 15
},
{
"name": "Maintains request cache",
"description": "Maintains a registry/cache that maps request paths to pending response promises, enabling request deduplication",
"max_score": 15
},
{
"name": "Cleans up cache",
"description": "Properly cleans up the cache by removing completed requests (both successful and failed) from the registry after they resolve or reject",
"max_score": 10
},
{
"name": "Returns proper structure",
"description": "Returns the correct structure from the request handler: either the original request object for new requests or a ComplexRequest object for duplicates",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-restevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10