-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #812 from ninoseki/refactoring
Refactoring
- Loading branch information
Showing
12 changed files
with
142 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
import { err, Result } from "neverthrow"; | ||
import { errAsync, ResultAsync } from "neverthrow"; | ||
|
||
import type { ScannableType, Scanner } from "~/types"; | ||
|
||
export class Base implements Scanner { | ||
public baseURL: string; | ||
public name: string; | ||
public supportedTypes: ScannableType[] = []; | ||
public apiKey: string | undefined = undefined; | ||
public apiKey?: string = undefined; | ||
public apiKeyRequired: boolean = true; | ||
|
||
public constructor() { | ||
this.baseURL = "http://example.com"; | ||
this.name = "Base"; | ||
} | ||
|
||
public setAPIKey(apiKey: string | undefined): void { | ||
public setAPIKey(apiKey?: string): void { | ||
this.apiKey = apiKey; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
public async scanByURL(url: string): Promise<Result<string, string>> { | ||
return err("Not implemented"); | ||
public scanByURL(url: string): ResultAsync<string, string> { | ||
return errAsync("Not implemented"); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
public async scanByIP(url: string): Promise<Result<string, string>> { | ||
return err("Not implemented"); | ||
public scanByIP(url: string): ResultAsync<string, string> { | ||
return errAsync("Not implemented"); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
public async scanByDomain(url: string): Promise<Result<string, string>> { | ||
return err("Not implemented"); | ||
public scanByDomain(url: string): ResultAsync<string, string> { | ||
return errAsync("Not implemented"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.