Skip to content

TypeScript - Reconsider RequestInfo class name as the name is built-in in the language  #551

@nikithauc

Description

@nikithauc

RequestInfo is defined in the TypeScript library as follows:

Please check my question on StackOverFlow for more info: https://stackoverflow.com/questions/68970860/typescript-using-predefined-names-for-custom-class-names.

The following prompts a Duplicate Identifier error :

class RequestInfo{}

However, adding the export keyword export class RequestInfo removes the error. I learnt from the TS community that reusing a built-in name is not recommended.

Additionally, use HTTPContext or MiddlewareContext which would be the conventional term for the purpose of this class. Examples: GraphRequestContext in Graph dot net core,
RequestContext -> https://github.com/microsoftgraph/msgraph-sdk-design/blob/master/middleware/RequestContext.md,
HTTPContext - https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcontext?view=netframework-4.8

AB#10917

Metadata

Metadata

Assignees

Labels

CsharpPull requests that update .net codeGoJavaRubyTypeScriptPull requests that update Javascript codefixed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions