Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (
mode === MODES.PASSTHROUGH ||
pollyRequest.shouldPassthrough ||
interceptor.shouldPassthrough
) {
return this.passthrough(pollyRequest);
}
this.assert(
'A persister must be configured in order to record and replay requests.',
!!this.persister
);
if (mode === MODES.RECORD) {
return this.record(pollyRequest);
}
if (mode === MODES.REPLAY) {
return this.replay(pollyRequest);
}
// This should never be reached. If it did, then something screwy happened.
this.assert(
'Unhandled request: \n' + stringifyRequest(pollyRequest, null, 2)
);
}
record() {
this.mode = MODES.RECORD;
}