Skip to content

Commit e82ff16

Browse files
committed
fix(ts): Workaround for typescript issue
1 parent dfc780d commit e82ff16

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/interceptor-request-internal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ import { InterceptorUtils } from './interceptor-utils';
66

77
export class InterceptorRequestInternal extends InterceptorRequest {
88

9+
/**
10+
* Hack
11+
* TODO: Point to typescript bug
12+
*/
13+
constructor() {
14+
super(null);
15+
}
16+
917
getShortCircuitAtCurrentStep(): boolean {
1018
return this._shortCircuitAtCurrentStep;
1119
}

src/interceptor-response-wrapper-builder-internal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ export class InterceptorResponseWrapperBuilderInternal extends InterceptorRespon
2121
} else if (from instanceof InterceptorResponseWrapper) {
2222
InterceptorUtils.assign(builder, <InterceptorResponseWrapper>from);
2323
} else {
24-
const request: InterceptorRequestInternal = <InterceptorRequestInternal>from;
25-
InterceptorUtils.assign(builder, request);
24+
const request: InterceptorRequestInternal = new InterceptorRequestInternal();
25+
InterceptorUtils.assign(request, from);
26+
InterceptorUtils.assign(builder, from);
2627
if (request.getShortCircuitAtCurrentStep()) {
2728
builder.shortCircuitTriggeredBy(interceptorStep - 1)
2829
.forceRequestCompletion(request.getAlsoForceRequestCompletion());

0 commit comments

Comments
 (0)