scaffolder-backend: fix review nit

This commit is contained in:
Patrik Oldsberg
2020-10-27 10:00:40 +01:00
parent 7c28026ae0
commit c46cdf34e3
2 changed files with 6 additions and 7 deletions
@@ -46,9 +46,9 @@ export class Preparers implements PreparerBuilder {
if (!preparer) {
if ((protocol as string) === 'url') {
const type = this.typeDetector?.(location);
const preparer2 = type && this.preparerMap.get(type as RemoteProtocol);
if (preparer2) {
return preparer2;
const detected = type && this.preparerMap.get(type as RemoteProtocol);
if (detected) {
return detected;
}
throw new Error(`No preparer integration found for url "${location}"`);
}
@@ -47,10 +47,9 @@ export class Publishers implements PublisherBuilder {
if (!publisher) {
if ((protocol as string) === 'url') {
const type = this.typeDetector?.(location);
const publisher2 =
type && this.publisherMap.get(type as RemoteProtocol);
if (publisher2) {
return publisher2;
const detected = type && this.publisherMap.get(type as RemoteProtocol);
if (detected) {
return detected;
}
throw new Error(`No preparer integration found for url "${location}"`);
}