Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace runtime enum BotKind with plain object #136

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,29 @@ export const enum State {
* @readonly
* @enum {string}
*/
export enum BotKind {
Awesomium = 'awesomium',
Cef = 'cef',
CefSharp = 'cefsharp',
CoachJS = 'coachjs',
Electron = 'electron',
FMiner = 'fminer',
Geb = 'geb',
NightmareJS = 'nightmarejs',
Phantomas = 'phantomas',
PhantomJS = 'phantomjs',
Rhino = 'rhino',
Selenium = 'selenium',
Sequentum = 'sequentum',
SlimerJS = 'slimerjs',
WebDriverIO = 'webdriverio',

WebDriver = 'webdriver',
HeadlessChrome = 'headless_chrome',
Unknown = 'unknown',
}
export const BotKind = {
Finesse marked this conversation as resolved.
Show resolved Hide resolved
Awesomium: 'awesomium',
Cef: 'cef',
CefSharp: 'cefsharp',
CoachJS: 'coachjs',
Electron: 'electron',
FMiner: 'fminer',
Geb: 'geb',
NightmareJS: 'nightmarejs',
Phantomas: 'phantomas',
PhantomJS: 'phantomjs',
Rhino: 'rhino',
Selenium: 'selenium',
Sequentum: 'sequentum',
SlimerJS: 'slimerjs',
WebDriverIO: 'webdriverio',

WebDriver: 'webdriver',
HeadlessChrome: 'headless_chrome',
Unknown: 'unknown',
} as const

export type BotKind = typeof BotKind[keyof typeof BotKind]

export type DetectorResponse = boolean | BotKind | undefined

Expand Down
Loading