Skip to content

Commit 10ff66a

Browse files
author
nebarf
committed
Remove useless comments
1 parent 8550f60 commit 10ff66a

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/client/http-context.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,27 @@ export class HttpContextToken<ValueT> {
55
export class HttpContext {
66
private readonly map = new Map<HttpContextToken<unknown>, unknown>();
77

8-
/**
9-
* Store a value in the context. If a value is already present it will be overwritten.
10-
*/
118
set<T>(token: HttpContextToken<T>, value: T): HttpContext {
129
this.map.set(token, value);
1310
return this;
1411
}
1512

16-
/**
17-
* Retrieve the value associated with the given token.
18-
*/
1913
get<T>(token: HttpContextToken<T>): T | undefined {
2014
if (!this.map.has(token)) {
21-
this.map.set(token, token.defaultValue);
15+
return token.defaultValue;
2216
}
2317
return this.map.get(token) as T;
2418
}
2519

26-
/**
27-
* Delete the value associated with the given token.
28-
*/
2920
delete(token: HttpContextToken<unknown>): HttpContext {
3021
this.map.delete(token);
3122
return this;
3223
}
3324

34-
/**
35-
* Checks for existence of a given token.
36-
*/
3725
has(token: HttpContextToken<unknown>): boolean {
3826
return this.map.has(token);
3927
}
4028

41-
/**
42-
* @returns a list of tokens currently stored in the context.
43-
*/
4429
keys(): IterableIterator<HttpContextToken<unknown>> {
4530
return this.map.keys();
4631
}

0 commit comments

Comments
 (0)